changed running in queue detection
This commit is contained in:
parent
c394f81c52
commit
9ce3286be8
|
|
@ -37,10 +37,6 @@ class Queue extends Provider
|
|||
});
|
||||
|
||||
app('events')->listen(JobProcessing::class, function ($event) {
|
||||
if (! defined('APP_RUNNING_IN_QUEUE')) {
|
||||
define('APP_RUNNING_IN_QUEUE', true);
|
||||
}
|
||||
|
||||
$payload = $event->job->payload();
|
||||
|
||||
if (! array_key_exists('company_id', $payload)) {
|
||||
|
|
|
|||
|
|
@ -171,7 +171,11 @@ if (! function_exists('running_in_queue')) {
|
|||
*/
|
||||
function running_in_queue(): bool
|
||||
{
|
||||
return defined('APP_RUNNING_IN_QUEUE') ?? false;
|
||||
return app()->runningConsoleCommand([
|
||||
'queue:work',
|
||||
'queue:listen',
|
||||
'horizon',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue