feat: candidate_filter 加单例守卫(规范5.3)
This commit is contained in:
@@ -373,6 +373,15 @@ def stage5_fundamental(code, name, price):
|
|||||||
# ── 主流程 ──
|
# ── 主流程 ──
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
# ── 单例守卫(规范5.3,2026-08-10)──
|
||||||
|
import fcntl
|
||||||
|
lock_f = open("/tmp/candidate_filter.lock", "w")
|
||||||
|
try:
|
||||||
|
fcntl.flock(lock_f, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||||
|
except OSError:
|
||||||
|
print("[FILTER] 已有实例在运行,退出")
|
||||||
|
return
|
||||||
|
|
||||||
stage_filter = None
|
stage_filter = None
|
||||||
single_code = None
|
single_code = None
|
||||||
for i, arg in enumerate(sys.argv[1:]):
|
for i, arg in enumerate(sys.argv[1:]):
|
||||||
|
|||||||
Reference in New Issue
Block a user