-
Notifications
You must be signed in to change notification settings - Fork 247
Expand file tree
/
Copy pathTerminateHorizon.php
More file actions
44 lines (37 loc) · 911 Bytes
/
TerminateHorizon.php
File metadata and controls
44 lines (37 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
namespace ProcessMaker\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Log;
class TerminateHorizon implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable;
/**
* Number of tries to run this job
*
* @var int
*/
public $tries = 1;
public function __construct()
{
//
}
/**
* Execute the job.
*
* @return void
*/
public function handle(): void
{
$exitCode = Artisan::call('horizon:terminate', [
'--no-interaction' => true,
]);
Log::info('Horizon Restart Attempted', [
'exit_code' => $exitCode,
'command_output' => Artisan::output(),
]);
}
}