mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-14 02:15:51 +00:00
fix(backups): retain volume backups without server
This commit is contained in:
1 parent
b97a97e955
commit
994eee8377
2 files changed
+41
-2
No files matched your search
@@ -2010,6 +2010,34 @@ it('dispatches due scheduled directory backups', function () {
|
||||
);
|
||||
});
|
||||
|
||||
it('retains scheduled volume backups and archive metadata when the server is missing', function () {
|
||||
config(['constants.coolify.self_hosted' => true]);
|
||||
Queue::fake();
|
||||
$team = Team::factory()->create();
|
||||
[$application, $volume] = createVolumeBackupApplication($team);
|
||||
$backup = $volume->scheduledBackups()->create([
|
||||
'team_id' => $team->id,
|
||||
'frequency' => '* * * * *',
|
||||
'enabled' => true,
|
||||
]);
|
||||
$execution = ScheduledVolumeBackupExecution::create([
|
||||
'scheduled_volume_backup_id' => $backup->id,
|
||||
'status' => 'success',
|
||||
'filename' => '/data/coolify/backups/volumes/test/archive.tar.gz',
|
||||
]);
|
||||
$application->update([
|
||||
'destination_id' => null,
|
||||
'destination_type' => null,
|
||||
]);
|
||||
|
||||
(new ScheduledJobManager)->handle();
|
||||
|
||||
expect($backup->fresh())->not->toBeNull()
|
||||
->and($execution->fresh())->not->toBeNull()
|
||||
->and($execution->fresh()->filename)->toBe('/data/coolify/backups/volumes/test/archive.tar.gz');
|
||||
Queue::assertNotPushed(VolumeBackupJob::class);
|
||||
});
|
||||
|
||||
it('dispatches pending recovery without starting another volume backup', function () {
|
||||
config(['constants.coolify.self_hosted' => true]);
|
||||
Queue::fake();
|
||||
|
||||
Reference in new issue
Block a user