!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/dokan/script/vendor/enlightn/enlightn/src/Analyzers/Reliability/   drwxrwxrwx
Free 13.03 GB of 57.97 GB (22.48%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     QueueTimeoutAnalyzer.php (3.52 KB)      -rwxrwxrwx
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace Enlightn\Enlightn\Analyzers\Reliability;

use 
Enlightn\Enlightn\Analyzers\Concerns\ParsesConfigurationFiles;
use 
Illuminate\Contracts\Config\Repository as ConfigRepository;

class 
QueueTimeoutAnalyzer extends ReliabilityAnalyzer
{
    use 
ParsesConfigurationFiles;

    
/**
     * The title describing the analyzer.
     *
     * @var string|null
     */
    
public $title 'An appropriate timeout and retry after is set for queues.';

    
/**
     * The severity of the analyzer.
     *
     * @var string|null
     */
    
public $severity self::SEVERITY_CRITICAL;

    
/**
     * The time to fix in minutes.
     *
     * @var int|null
     */
    
public $timeToFix 2;

    
/**
     * The name of the queue connection that has an error.
     *
     * @var string
     */
    
public $connectionName null;

    
/**
     * The retry after queue configuration value.
     *
     * @var int
     */
    
public $retryAfter 60;

    
/**
     * The timeout queue configuration value.
     *
     * @var int
     */
    
public $timeout 60;

    
/**
     * Get the error message describing the analyzer insights.
     *
     * @return string
     */
    
public function errorMessage()
    {
        return 
"The queue timeout value must be at least several seconds shorter than the retry after "
                
."configuration value. Your {$this->connectionName} queue connection's retry after value "
                
."is set at {$this->retryAfter} seconds while your timeout value is set at {$this->timeout} "
                
."seconds. This can cause problems such as your jobs may be processed twice or the queue "
                
."worker may crash.";
    }

    
/**
     * Execute the analyzer.
     *
     * @param  \Illuminate\Contracts\Config\Repository  $config
     * @return void
     */
    
public function handle(ConfigRepository $config)
    {
        
$connections collect($config->get('queue.connections', []))
            ->
filter(function ($conf$queue) {
                
// skip sqs and sync drivers as they don't have retry after values
                
return ! in_array($conf['driver'], ['sqs''sync']);
            })->
map(function ($conf$queue) {
                return 
$this->getTimeoutAndRetryAfter($conf);
            })->
filter(function ($conf) {
                return 
$conf['timeout'] >= $conf['retry_after'];
            });

        if (
$connections->count() > 0) {
            
$faultyConnection $connections->first();

            
$this->connectionName $connections->keys()->first();
            
$this->timeout $faultyConnection['timeout'];
            
$this->retryAfter $faultyConnection['retry_after'];

            
$this->recordError('queue''retry_after', ['connections'$this->connectionName]);
        }
    }

    
/**
     * Get the timeout and retry after values for the configuration.
     *
     * @param  array  $config
     * @return array
     */
    
public function getTimeoutAndRetryAfter(array $config)
    {
        if ((
$config['driver'] ?? null) !== 'redis') {
            return [
'timeout' => 60'retry_after' => ($config['retry_after'] ?? 60)];
        }

        
// Timeout is as defined in the horizon config (if app uses Horizon) with fallback to default
        // queue worker timeout of 60 seconds.
        
$timeout array_reduce(array_merge(
            
data_get(config('horizon.defaults', []), '*.timeout'),
            
data_get(config('horizon.environments', []), '*.*.timeout')
        ), 
'max') ?? 60;

        return [
'timeout' => $timeout'retry_after' => ($config['retry_after'] ?? 60)];
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0049 ]--