fix(ScheduledTaskJob): make server property nullable and update logging to handle null values
This commit is contained in:
parent
eb70fe00ff
commit
644df223dc
1 changed files with 3 additions and 3 deletions
|
|
@ -41,7 +41,7 @@ class ScheduledTaskJob implements ShouldQueue
|
||||||
|
|
||||||
public Team $team;
|
public Team $team;
|
||||||
|
|
||||||
public Server $server;
|
public ?Server $server = null;
|
||||||
|
|
||||||
public ScheduledTask $task;
|
public ScheduledTask $task;
|
||||||
|
|
||||||
|
|
@ -166,7 +166,7 @@ public function handle(): void
|
||||||
'job' => 'ScheduledTaskJob',
|
'job' => 'ScheduledTaskJob',
|
||||||
'task_id' => $this->task->uuid,
|
'task_id' => $this->task->uuid,
|
||||||
'task_name' => $this->task->name,
|
'task_name' => $this->task->name,
|
||||||
'server' => $this->server->name ?? 'unknown',
|
'server' => $this->server?->name ?? 'unknown',
|
||||||
'attempt' => $this->attempts(),
|
'attempt' => $this->attempts(),
|
||||||
'error' => $e->getMessage(),
|
'error' => $e->getMessage(),
|
||||||
]);
|
]);
|
||||||
|
|
@ -206,7 +206,7 @@ public function failed(?\Throwable $exception): void
|
||||||
'job' => 'ScheduledTaskJob',
|
'job' => 'ScheduledTaskJob',
|
||||||
'task_id' => $this->task->uuid,
|
'task_id' => $this->task->uuid,
|
||||||
'task_name' => $this->task->name,
|
'task_name' => $this->task->name,
|
||||||
'server' => $this->server->name ?? 'unknown',
|
'server' => $this->server?->name ?? 'unknown',
|
||||||
'total_attempts' => $this->attempts(),
|
'total_attempts' => $this->attempts(),
|
||||||
'error' => $exception?->getMessage(),
|
'error' => $exception?->getMessage(),
|
||||||
'trace' => $exception?->getTraceAsString(),
|
'trace' => $exception?->getTraceAsString(),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue