|
@@ -2,6 +2,7 @@ import time
|
|
|
import schedule
|
|
|
import multiprocessing
|
|
|
from common.scheduling_db import MysqlHelper
|
|
|
+from common.aliyun_log import AliyunLogger
|
|
|
|
|
|
|
|
|
def read_accounts_from_mysql():
|
|
@@ -65,6 +66,13 @@ def insert_accounts(account_dict):
|
|
|
platform_name = list(platform)[0]
|
|
|
sql = f"""INSERT INTO changsha_user_accounts (piaoquan_account_id, user_name, platform) VALUES ('{key}', '{user_name}', '{platform_name}');"""
|
|
|
MysqlHelper.update_values(log_type="author", crawler="changsha", sql=sql, env="prod")
|
|
|
+ AliyunLogger.logging(
|
|
|
+ code="8888",
|
|
|
+ platform=platform,
|
|
|
+ mode="author",
|
|
|
+ env="prod",
|
|
|
+ message="更新账号-{}-{}".format(user_name, key)
|
|
|
+ )
|
|
|
|
|
|
|
|
|
def protect_(function):
|
|
@@ -95,8 +103,9 @@ def main():
|
|
|
"""
|
|
|
定时执行任务, 每天晚上更新账号
|
|
|
"""
|
|
|
- schedule.every().day.at("23:40").do(process_acc)
|
|
|
+ schedule.every().day.at("19:07").do(process_acc)
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
- protect_(main())
|
|
|
+ # protect_(main)
|
|
|
+ process_acc()
|