mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 21:18:11 -04:00
fix(storage): let the S3 revalidation unique lock expire
RevalidateUnusableS3StoragesJob had no uniqueFor. A lock left by a stopped worker blocked the job for up to 24 hours, so unusable S3 storages were not checked again and their backups were skipped. - Set uniqueFor to 1800 seconds
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
use App\Jobs\RevalidateUnusableS3StoragesJob;
|
||||
use Illuminate\Support\Facades\Queue;
|
||||
|
||||
beforeEach(function () {
|
||||
config()->set('cache.default', 'array');
|
||||
Queue::fake();
|
||||
});
|
||||
|
||||
it('does not queue a second revalidation while the unique lock is held', function () {
|
||||
RevalidateUnusableS3StoragesJob::dispatch();
|
||||
$this->travel(29)->minutes();
|
||||
RevalidateUnusableS3StoragesJob::dispatch();
|
||||
|
||||
Queue::assertPushed(RevalidateUnusableS3StoragesJob::class, 1);
|
||||
});
|
||||
|
||||
it('queues the revalidation again after a lock left by a killed worker expires', function () {
|
||||
RevalidateUnusableS3StoragesJob::dispatch();
|
||||
$this->travel(31)->minutes();
|
||||
RevalidateUnusableS3StoragesJob::dispatch();
|
||||
|
||||
Queue::assertPushed(RevalidateUnusableS3StoragesJob::class, 2);
|
||||
});
|
||||
Reference in New Issue
Block a user