Merge pull request #1664 from coollabsio/next

v4.0.0-beta.198
This commit is contained in:
Andras Bacsai 2024-01-18 15:06:12 +01:00 committed by GitHub
commit 838c3830d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 34 additions and 16 deletions

View File

@ -0,0 +1,23 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
class CleanupQueue extends Command
{
protected $signature = 'cleanup:queue';
protected $description = 'Cleanup Queue';
public function handle()
{
echo "Running queue cleanup...\n";
$prefix = config('database.redis.options.prefix');
$keys = Redis::connection()->keys('*:laravel*');
foreach ($keys as $key) {
$keyWithoutPrefix = str_replace($prefix, '', $key);
Redis::connection()->del($keyWithoutPrefix);
}
}
}

View File

@ -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;

View File

@ -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()
{

View File

@ -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()) {

View File

@ -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

View File

@ -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,
];

View File

@ -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'),

View File

@ -1,3 +1,3 @@
<?php
return '4.0.0-beta.197';
return '4.0.0-beta.198';

View File

@ -4,7 +4,7 @@
"version": "3.12.36"
},
"v4": {
"version": "4.0.0-beta.197"
"version": "4.0.0-beta.198"
}
}
}