feat: new server checking job
feat: show if the server has problems on ui
This commit is contained in:
@@ -12,6 +12,7 @@ use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Support\Facades\RateLimiter;
|
||||
|
||||
class Revived extends Notification implements ShouldQueue
|
||||
{
|
||||
@@ -44,8 +45,20 @@ class Revived extends Notification implements ShouldQueue
|
||||
if ($isTelegramEnabled) {
|
||||
$channels[] = TelegramChannel::class;
|
||||
}
|
||||
$executed = RateLimiter::attempt(
|
||||
'notification-server-revived-'.$this->server->uuid,
|
||||
1,
|
||||
function () use ($channels) {
|
||||
return $channels;
|
||||
},
|
||||
7200,
|
||||
);
|
||||
|
||||
return $channels;
|
||||
if (! $executed) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return $executed;
|
||||
}
|
||||
|
||||
public function toMail(): MailMessage
|
||||
|
||||
Reference in New Issue
Block a user