MCPcopy Create free account
hub / github.com/C3ting/ARL / recover_task

Function recover_task

app/utils/github_task.py:123–137  ·  view source on GitHub ↗
(_id)

Source from the content-addressed store, hash-verified

121
122# 恢复 Github 监控任务,只是改变状态
123def recover_task(_id):
124 from app.modules import SchedulerStatus
125 if len(_id) != 24:
126 return
127
128 item = find_github_scheduler(_id)
129 item["status"] = SchedulerStatus.RUNNING
130 entry = CronTab(item["cron"])
131 next_sec = entry.next(default_utc=False)
132 item["next_run_date"] = utils.time2date(time.time() + next_sec)
133
134 query = {
135 "_id": ObjectId(_id)
136 }
137 utils.conn_db('github_scheduler').find_one_and_replace(query, item)
138
139
140# 停止Github 监控任务,只是改变状态

Callers

nothing calls this directly

Calls 1

find_github_schedulerFunction · 0.85

Tested by

no test coverage detected