-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f524853
commit 8ae69a8
Showing
7 changed files
with
247 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Jobs\BackupTasks; | ||
|
||
use App\Models\BackupTask; | ||
use App\Models\BackupTaskLog; | ||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
use Illuminate\Foundation\Bus\Dispatchable; | ||
use Illuminate\Queue\InteractsWithQueue; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
/** | ||
* Job to send Pushover notifications for backup tasks. | ||
* | ||
* This job is responsible for dispatching Pushover notifications | ||
* related to backup tasks and their logs. | ||
*/ | ||
class SendPushoverNotificationJob implements ShouldQueue | ||
{ | ||
use Dispatchable; | ||
use InteractsWithQueue; | ||
use Queueable; | ||
use SerializesModels; | ||
|
||
/** | ||
* Create a new job instance. | ||
* | ||
* @param BackupTask $backupTask The backup task associated with the notification | ||
* @param BackupTaskLog $backupTaskLog The log entry for the backup task | ||
* @param string $notificationStreamValue The value of the notification stream | ||
*/ | ||
public function __construct( | ||
public BackupTask $backupTask, | ||
public BackupTaskLog $backupTaskLog, | ||
public string $notificationStreamValue | ||
) { | ||
// | ||
} | ||
|
||
/** | ||
* Execute the job. | ||
* | ||
* Sends a Pushover notification for the backup task. | ||
*/ | ||
public function handle(): void | ||
{ | ||
$this->backupTask->sendPushoverNotification($this->backupTaskLog, $this->notificationStreamValue); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.