|
@@ -21,7 +21,7 @@ def hourly():
|
|
|
def daily():
|
|
|
|
|
|
t11 = threading.Thread(target=old_cost_daily, args=())
|
|
|
- t12 = threading.Thread(target=insert_order_data_daily())
|
|
|
+ t12 = threading.Thread(target=insert_order_data_daily)
|
|
|
|
|
|
t11.start()
|
|
|
t11.join()
|
|
@@ -39,5 +39,19 @@ def cost_yestoday_repair():
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
- hourly()
|
|
|
+ import logging
|
|
|
+ from logging import handlers
|
|
|
+ logging.basicConfig(
|
|
|
+ handlers=[
|
|
|
+ logging.handlers.RotatingFileHandler('task.log',
|
|
|
+ maxBytes=10 * 1024 * 1024,
|
|
|
+ backupCount=5,
|
|
|
+ encoding='utf-8')
|
|
|
+ , logging.StreamHandler() # 供输出使用
|
|
|
+ ],
|
|
|
+ level=logging.INFO,
|
|
|
+ format="%(asctime)s - %(levelname)s %(filename)s %(funcName)s %(lineno)s - %(message)s"
|
|
|
+ )
|
|
|
+ # hourly()
|
|
|
# cost_yestoday_repair()
|
|
|
+ daily()
|