diff --git a/app/Console/Commands/CleanupQueue.php b/app/Console/Commands/CleanupQueue.php new file mode 100644 index 000000000..4d8fe8f6a --- /dev/null +++ b/app/Console/Commands/CleanupQueue.php @@ -0,0 +1,23 @@ +keys('*:laravel*'); + foreach ($keys as $key) { + $keyWithoutPrefix = str_replace($prefix, '', $key); + Redis::connection()->del($keyWithoutPrefix); + } + } +} diff --git a/app/Console/Commands/Emails.php b/app/Console/Commands/Emails.php index 821041002..86f317c96 100644 --- a/app/Console/Commands/Emails.php +++ b/app/Console/Commands/Emails.php @@ -9,8 +9,6 @@ use App\Models\Server; use App\Models\StandalonePostgresql; use App\Models\Team; -use App\Models\TeamInvitation; -use App\Models\User; use App\Models\Waitlist; use App\Notifications\Application\DeploymentFailed; use App\Notifications\Application\DeploymentSuccess; @@ -18,13 +16,11 @@ use App\Notifications\Database\BackupFailed; use App\Notifications\Database\BackupSuccess; use App\Notifications\Test; -use App\Notifications\TransactionalEmails\InvitationLink; use Exception; use Illuminate\Console\Command; use Illuminate\Mail\Message; use Illuminate\Notifications\Messages\MailMessage; use Mail; -use Illuminate\Support\Str; use function Laravel\Prompts\confirm; use function Laravel\Prompts\select; diff --git a/app/Console/Commands/Init.php b/app/Console/Commands/Init.php index 2791a86f4..798dcf275 100644 --- a/app/Console/Commands/Init.php +++ b/app/Console/Commands/Init.php @@ -30,7 +30,7 @@ public function handle() $this->alive(); $cleanup = $this->option('cleanup'); if ($cleanup) { - echo "Running cleanup\n"; + echo "Running cleanups...\n"; $this->cleanup_stucked_resources(); // Required for falsely deleted coolify db $this->restore_coolify_db_backup(); @@ -54,6 +54,7 @@ public function handle() $settings->update(['is_auto_update_enabled' => false]); } } + $this->call('cleanup:queue'); } private function restore_coolify_db_backup() { diff --git a/app/Jobs/ContainerStatusJob.php b/app/Jobs/ContainerStatusJob.php index b9fa3443f..86c879a3b 100644 --- a/app/Jobs/ContainerStatusJob.php +++ b/app/Jobs/ContainerStatusJob.php @@ -27,6 +27,9 @@ public function backoff(): int { return isDev() ? 1 : 3; } + public function __construct(public Server $server) + { + } public function middleware(): array { return [(new WithoutOverlapping($this->server->uuid))]; @@ -37,11 +40,6 @@ public function uniqueId(): int return $this->server->uuid; } - public function __construct(public Server $server) - { - $this->handle(); - } - public function handle() { if (!$this->server->isFunctional()) { diff --git a/app/Jobs/PullHelperImageJob.php b/app/Jobs/PullHelperImageJob.php index f06e9524d..848c316f2 100644 --- a/app/Jobs/PullHelperImageJob.php +++ b/app/Jobs/PullHelperImageJob.php @@ -19,7 +19,7 @@ class PullHelperImageJob implements ShouldQueue, ShouldBeEncrypted public function middleware(): array { - return [(new WithoutOverlapping($this->server->uuid))->dontRelease()]; + return [(new WithoutOverlapping($this->server->uuid))]; } public function uniqueId(): string diff --git a/app/Notifications/Container/ContainerStopped.php b/app/Notifications/Container/ContainerStopped.php index ac218c5fe..7bab74934 100644 --- a/app/Notifications/Container/ContainerStopped.php +++ b/app/Notifications/Container/ContainerStopped.php @@ -37,12 +37,12 @@ public function toMail(): MailMessage public function toDiscord(): string { - $message = "Coolify: A resource has been stopped unexpectedly on {$this->server->name}"; + $message = "Coolify: A resource ($this->name) has been stopped unexpectedly on {$this->server->name}"; return $message; } public function toTelegram(): array { - $message = "Coolify: A resource has been stopped unexpectedly on {$this->server->name}"; + $message = "Coolify: A resource ($this->name) has been stopped unexpectedly on {$this->server->name}"; $payload = [ "message" => $message, ]; diff --git a/config/sentry.php b/config/sentry.php index f1f17f030..ccae430a3 100644 --- a/config/sentry.php +++ b/config/sentry.php @@ -7,7 +7,7 @@ // The release version of your application // Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')) - 'release' => '4.0.0-beta.197', + 'release' => '4.0.0-beta.198', // When left empty or `null` the Laravel environment will be used 'environment' => config('app.env'), diff --git a/config/version.php b/config/version.php index 32e5b5873..e5829a919 100644 --- a/config/version.php +++ b/config/version.php @@ -1,3 +1,3 @@