mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-04 10:42:23 +00:00
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
26 lines
779 B
PHP
26 lines
779 B
PHP
<?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);
|
|
});
|