提交同步状态为异步
This commit is contained in:
@@ -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/');
|
||||
|
||||
Reference in New Issue
Block a user