deploy: auto commit repo-root changes 2026-06-21 17:13:24
This commit is contained in:
@@ -30,6 +30,11 @@ DEFAULT_HEADERS = {
|
||||
}
|
||||
|
||||
|
||||
def _should_use_internal_lock() -> bool:
|
||||
flag = str(os.environ.get("DQD_RUNNING_UNDER_TASK_RUNNER") or "").strip().lower()
|
||||
return flag not in {"1", "true", "yes", "on"}
|
||||
|
||||
|
||||
def parse_match_live_detail_html(body: str) -> dict:
|
||||
match = DETAIL_JSONP_RE.search((body or "").strip())
|
||||
if not match:
|
||||
@@ -233,14 +238,16 @@ class MatchLiveStreamRepository:
|
||||
|
||||
|
||||
def run(db_config: Dict[str, Any]) -> Dict[str, Any]:
|
||||
lock = TaskFileLock("match_live_stream")
|
||||
if not lock.acquire():
|
||||
return {
|
||||
"success": True,
|
||||
"candidate_count": 0,
|
||||
"saved_count": 0,
|
||||
"summary_text": "match_live_stream 已在执行中,跳过本次",
|
||||
}
|
||||
lock = None
|
||||
if _should_use_internal_lock():
|
||||
lock = TaskFileLock("match_live_stream")
|
||||
if not lock.acquire():
|
||||
return {
|
||||
"success": True,
|
||||
"candidate_count": 0,
|
||||
"saved_count": 0,
|
||||
"summary_text": "match_live_stream 已在执行中,跳过本次",
|
||||
}
|
||||
|
||||
repo = MatchLiveStreamRepository(db_config)
|
||||
now_ts = int(time.time())
|
||||
@@ -265,4 +272,5 @@ def run(db_config: Dict[str, Any]) -> Dict[str, Any]:
|
||||
return _build_run_result(candidate_count, success_count, failed_count)
|
||||
finally:
|
||||
repo.close()
|
||||
lock.release()
|
||||
if lock is not None:
|
||||
lock.release()
|
||||
|
||||
Reference in New Issue
Block a user