mirror of
https://github.com/coollabsio/coolify.git
synced 2026-08-24 10:05:47 -05:00
fix(backups): preserve existing volume backup timeouts
Change only the default timeout for new volume backups without modifying existing schedules.
This commit is contained in:
@@ -2,17 +2,12 @@
|
|||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
return new class extends Migration
|
return new class extends Migration
|
||||||
{
|
{
|
||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
DB::table('scheduled_volume_backups')
|
|
||||||
->where('timeout', 3600)
|
|
||||||
->update(['timeout' => 36000]);
|
|
||||||
|
|
||||||
Schema::table('scheduled_volume_backups', function (Blueprint $table) {
|
Schema::table('scheduled_volume_backups', function (Blueprint $table) {
|
||||||
$table->unsignedInteger('timeout')->default(36000)->change();
|
$table->unsignedInteger('timeout')->default(36000)->change();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ it('allows large volume backups to run for ten hours by default', function () {
|
|||||||
->and(config('queue.connections.redis.retry_after'))->toBeGreaterThan(config('horizon.defaults.s6.timeout'));
|
->and(config('queue.connections.redis.retry_after'))->toBeGreaterThan(config('horizon.defaults.s6.timeout'));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('upgrades existing default volume backup timeouts without changing custom timeouts', function () {
|
it('changes the default volume backup timeout without changing existing timeouts', function () {
|
||||||
$team = Team::factory()->create();
|
$team = Team::factory()->create();
|
||||||
[$application, $defaultVolume] = createVolumeBackupApplication($team);
|
[$application, $defaultVolume] = createVolumeBackupApplication($team);
|
||||||
$customVolume = LocalPersistentVolume::create([
|
$customVolume = LocalPersistentVolume::create([
|
||||||
@@ -84,7 +84,7 @@ it('upgrades existing default volume backup timeouts without changing custom tim
|
|||||||
$migration = require database_path('migrations/2026_08_15_000000_increase_default_volume_backup_timeout.php');
|
$migration = require database_path('migrations/2026_08_15_000000_increase_default_volume_backup_timeout.php');
|
||||||
$migration->up();
|
$migration->up();
|
||||||
|
|
||||||
expect($defaultBackup->fresh()->timeout)->toBe(36000)
|
expect($defaultBackup->fresh()->timeout)->toBe(3600)
|
||||||
->and($customBackup->fresh()->timeout)->toBe(7200);
|
->and($customBackup->fresh()->timeout)->toBe(7200);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user