mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-03 07:12:33 +00:00
feat: new server checking job
feat: show if the server has problems on ui
This commit is contained in:
1 parent
bc48b42ff1
commit
e4b92bb660
19 files changed
+539
-383
No files matched your search
@@ -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
|
||||
|
||||
@@ -10,6 +10,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 Unreachable extends Notification implements ShouldQueue
|
||||
{
|
||||
@@ -35,8 +36,20 @@ class Unreachable extends Notification implements ShouldQueue
|
||||
if ($isTelegramEnabled) {
|
||||
$channels[] = TelegramChannel::class;
|
||||
}
|
||||
$executed = RateLimiter::attempt(
|
||||
'notification-server-unreachable-'.$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