feat: scheduled task success and failure notifications

This commit is contained in:
peaklabs-dev
2024-12-10 14:45:47 +01:00
parent 96d4754a32
commit 99eea783ae
5 changed files with 12 additions and 9 deletions

View File

@@ -10,6 +10,7 @@ use App\Models\Server;
use App\Models\Service;
use App\Models\Team;
use App\Notifications\ScheduledTask\TaskFailed;
use App\Notifications\ScheduledTask\TaskSuccess;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
@@ -111,6 +112,8 @@ class ScheduledTaskJob implements ShouldQueue
'message' => $this->task_output,
]);
$this->team?->notify(new TaskSuccess($this->task, $this->task_output));
return;
}
}