Skip to content

Commit

Permalink
增加log
Browse files Browse the repository at this point in the history
  • Loading branch information
haikerwang committed Sep 16, 2023
1 parent 40a26dc commit fff8762
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions TimeTaskTool.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,16 @@ def timeCheck(self):

#是否到了凌晨00:00 - 目标时间,刷新今天的cron任务
if self.is_targetTime("00:00"):
new_array = [item.taskId for item in modelArray]
print(f"[timeTask] 触发了凌晨刷新任务~ 当前任务ID为:{new_array}")
self.refreshCronTask_identifier = ""
#刷新cron时间任务、周期任务的今天执行态
self.refresh_times(featureArray)

#是否到了迁移历史任务 - 目标时间
if self.is_targetTime(self.move_historyTask_time):
new_array = [item.taskId for item in modelArray]
print(f"[timeTask] 触发了迁移历史任务~ 当前任务ID为:{new_array}")
self.moveHistoryTask_identifier = ""
#迁移过期任务
self.moveTask_toHistory(historyArray)
Expand Down
5 changes: 4 additions & 1 deletion Tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,14 @@ def moveTasksToHistoryExcel(self, tasks, file_name=__file_name, sheet_name=__she
#保存
wb.save(workbook_file_path)

hisIds = []
#添加历史列表
for _, t in enumerate(tasks):
his_taskId = t[0]
hisIds.append(his_taskId)
self.addItemToExcel(t, file_name, history_sheet_name)

print(f"将任务Sheet({sheet_name})中的 过期任务 迁移指 -> 历史Sheet({history_sheet_name}) 完毕~")
print(f"将任务Sheet({sheet_name})中的 过期任务 迁移指 -> 历史Sheet({history_sheet_name}) 完毕~ \n 迁移的任务ID为:{hisIds}")

#返回最新数据
return self.readExcel()
Expand Down

0 comments on commit fff8762

Please sign in to comment.