mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-12 18:15:58 +00:00
1 parent
da07b4fdcf
commit
1fe4dd722b
349 files changed
+3689
-4184
No files matched your search
@@ -10,7 +10,6 @@ use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use RuntimeException;
|
||||
|
||||
class SendMessageToPushoverJob implements ShouldBeEncrypted, ShouldQueue
|
||||
{
|
||||
@@ -31,7 +30,7 @@ class SendMessageToPushoverJob implements ShouldBeEncrypted, ShouldQueue
|
||||
public int $maxExceptions = 5;
|
||||
|
||||
public function __construct(
|
||||
public PushoverMessage $pushoverMessage,
|
||||
public PushoverMessage $message,
|
||||
public string $token,
|
||||
public string $user,
|
||||
) {
|
||||
@@ -43,9 +42,9 @@ class SendMessageToPushoverJob implements ShouldBeEncrypted, ShouldQueue
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
$response = Http::post('https://api.pushover.net/1/messages.json', $this->pushoverMessage->toPayload($this->token, $this->user));
|
||||
$response = Http::post('https://api.pushover.net/1/messages.json', $this->message->toPayload($this->token, $this->user));
|
||||
if ($response->failed()) {
|
||||
throw new RuntimeException('Pushover notification failed with '.$response->status().' status code.'.$response->body());
|
||||
throw new \RuntimeException('Pushover notification failed with '.$response->status().' status code.'.$response->body());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user