Merge remote-tracking branch 'origin/main' into fix/limeng-agreement-subject-modal

This commit is contained in:
limeng 2026-11-24 18:49:31 +08:00
commit baee6d38fa
2 changed files with 13 additions and 4 deletions

View File

@ -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}

View File

@ -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