Merge remote-tracking branch 'origin/main' into fix/limeng-agreement-subject-modal
This commit is contained in:
commit
baee6d38fa
@ -13,9 +13,10 @@ use Throwable;
|
||||
|
||||
class SyncBusinessFilesToQiniu extends Command
|
||||
{
|
||||
private const PROBE_CLEANUP_MAX_ATTEMPTS = 10;
|
||||
// Qiniu can briefly report a deleted object as present; keep the wait bounded.
|
||||
private const PROBE_CLEANUP_MAX_ATTEMPTS = 20;
|
||||
|
||||
private const PROBE_CLEANUP_RETRY_DELAY_MICROSECONDS = 500_000;
|
||||
private const PROBE_CLEANUP_RETRY_DELAY_MICROSECONDS = 1_000_000;
|
||||
|
||||
protected $signature = 'storage:business-files:sync
|
||||
{--require-qiniu : Fail unless the private Qiniu backend is enabled}
|
||||
|
||||
@ -68,7 +68,7 @@ class SyncBusinessFilesToQiniuTest extends TestCase
|
||||
public function test_it_retries_probe_cleanup_until_qiniu_reports_the_object_missing(): void
|
||||
{
|
||||
$this->assertSame(
|
||||
[500_000, 500_000],
|
||||
[1_000_000, 1_000_000],
|
||||
$this->invokeProbeCleanup([true, true, false])
|
||||
);
|
||||
}
|
||||
@ -78,7 +78,15 @@ class SyncBusinessFilesToQiniuTest extends TestCase
|
||||
$this->expectException(\RuntimeException::class);
|
||||
$this->expectExceptionMessage('Business storage probe cleanup failed.');
|
||||
|
||||
$this->invokeProbeCleanup(array_fill(0, 10, true));
|
||||
$this->invokeProbeCleanup(array_fill(0, 20, true));
|
||||
}
|
||||
|
||||
public function test_probe_cleanup_accepts_delayed_visibility_after_the_previous_wait_window(): void
|
||||
{
|
||||
$this->assertSame(
|
||||
array_fill(0, 12, 1_000_000),
|
||||
$this->invokeProbeCleanup([...array_fill(0, 12, true), false])
|
||||
);
|
||||
}
|
||||
|
||||
private function invokeProbeCleanup(array $existsResults): array
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user