提交同步状态为异步

This commit is contained in:
root
2026-07-02 03:39:29 +08:00
parent 439f79a5ae
commit 638b3c4032
10 changed files with 724 additions and 46 deletions
@@ -43,6 +43,20 @@ class SplitTicketSyncLockService
}
}
/**
* 工单是否处于同步中(锁文件存在且未过期)
*/
public function isLocked(int $ticketId): bool
{
$path = $this->lockPath($ticketId);
if ($this->isStaleLock($path)) {
@unlink($path);
return false;
}
return is_file($path);
}
private function lockPath(int $ticketId): string
{
$runtime = defined('RUNTIME_PATH') ? RUNTIME_PATH : (dirname(__DIR__, 3) . '/runtime/');