|
@@ -88,11 +88,15 @@ class UpdateMsgDaily(object):
|
|
|
order by updateTime
|
|
|
desc
|
|
|
"""
|
|
|
- latest_update_time = cls.db_client.select(sql)[0][0]
|
|
|
- # 判断该账号当天发布的文章是否被收集
|
|
|
- if int(latest_update_time) > int(today_timestamp):
|
|
|
- return True
|
|
|
- else:
|
|
|
+ try:
|
|
|
+ latest_update_time = cls.db_client.select(sql)[0][0]
|
|
|
+ # 判断该账号当天发布的文章是否被收集
|
|
|
+ if int(latest_update_time) > int(today_timestamp):
|
|
|
+ return True
|
|
|
+ else:
|
|
|
+ return False
|
|
|
+ except Exception as e:
|
|
|
+ print("updateTime Error -- {}".format(e))
|
|
|
return False
|
|
|
|
|
|
@classmethod
|
|
@@ -125,9 +129,7 @@ class UpdateMsgDaily(object):
|
|
|
account_dict = cls.getAccountIdDict()
|
|
|
error_account_list = []
|
|
|
for account_id in tqdm(account_dict):
|
|
|
- if cls.checkEachAccount(account_id):
|
|
|
- continue
|
|
|
- else:
|
|
|
+ if not cls.checkEachAccount(account_id):
|
|
|
name = account_dict[account_id]
|
|
|
error_account_list.append(name)
|
|
|
if error_account_list:
|
|
@@ -150,17 +152,9 @@ def job_with_thread(job_func):
|
|
|
if __name__ == "__main__":
|
|
|
UMD = UpdateMsgDaily()
|
|
|
|
|
|
- try:
|
|
|
- schedule.every().day.at("21:00").do(job_with_thread, UMD.updateJob)
|
|
|
-
|
|
|
- except Exception as error:
|
|
|
- UMD.bot(account_list=["更新文章定时任务异常终止", str(error)])
|
|
|
-
|
|
|
- try:
|
|
|
- schedule.every().day.at("21:30").do(job_with_thread, UMD.checkJob)
|
|
|
+ schedule.every().day.at("21:00").do(job_with_thread, UMD.updateJob)
|
|
|
|
|
|
- except Exception as error:
|
|
|
- UMD.bot(account_list=['校验账号任务异常终止', str(error)])
|
|
|
+ schedule.every().day.at("21:30").do(job_with_thread, UMD.checkJob)
|
|
|
|
|
|
while True:
|
|
|
schedule.run_pending()
|