Add Debian deployment, MariaDB storage and randomized proxy routing
This commit is contained in:
+3
-3
@@ -67,7 +67,7 @@ class JobManager:
|
||||
|
||||
def _run(self, jid):
|
||||
job = self.get(jid)
|
||||
self.db.job_update(jid, status="running", errors=0, message="正在采集")
|
||||
self.db.job_update(jid, status="running", errors=0, resume_pending=0, message="正在采集")
|
||||
self.db.log(jid, "info", "任务开始/恢复,将跳过已完成单元")
|
||||
if self.transport:
|
||||
self.transport.local.guard = lambda: self.checkpoint(jid)
|
||||
@@ -127,7 +127,7 @@ class JobManager:
|
||||
raise ValueError("任务当前不在运行")
|
||||
with control["condition"]:
|
||||
control["paused"] = True
|
||||
self.db.job_update(jid, status="paused", message="已暂停,当前请求结束后停止")
|
||||
self.db.job_update(jid, status="paused", resume_pending=0, message="已暂停,当前请求结束后停止")
|
||||
return self.get(jid)
|
||||
|
||||
def resume(self, jid):
|
||||
@@ -169,7 +169,7 @@ class JobManager:
|
||||
if control["thread"].is_alive():
|
||||
with control['condition']:
|
||||
control['shutdown'] = True
|
||||
self.db.job_update(jid, status='paused', message='服务停止,任务可从断点恢复')
|
||||
self.db.job_update(jid, status='paused', resume_pending=int(not control['paused']), message='服务停止,任务可从断点恢复')
|
||||
control['condition'].notify_all()
|
||||
for control in list(self.controls.values()):
|
||||
control["thread"].join(timeout=1)
|
||||
|
||||
Reference in New Issue
Block a user