Explorar o código

长文数据库:增加 update方法

pq数据库,增加 close 方法
罗俊辉 hai 7 meses
pai
achega
4310bd9d0b
Modificáronse 1 ficheiros con 8 adicións e 7 borrados
  1. 8 7
      updatePublishedMsgDaily.py

+ 8 - 7
updatePublishedMsgDaily.py

@@ -320,7 +320,7 @@ def updateJob():
             time.sleep(5)
         except Exception as e:
             print(e)
-
+    db_client.close()
     print("服务号更新完成")
 
 
@@ -352,6 +352,8 @@ def checkJob():
         except Exception as e:
             print("Timeout Error: {}".format(e))
 
+    db_client.close()
+
 
 def job_with_thread(job_func):
     """
@@ -364,7 +366,6 @@ def job_with_thread(job_func):
 
 
 if __name__ == '__main__':
-
     schedule.every().day.at("20:50").do(job_with_thread, updateJob)
 
     schedule.every().day.at("21:30").do(job_with_thread, checkJob)
@@ -372,9 +373,9 @@ if __name__ == '__main__':
     while True:
         schedule.run_pending()
         time.sleep(0.5)
-        # log(
-        #     task="updatePublishedMsgDaily",
-        #     function="main",
-        #     message="更新公众号文章信息任务正常执行"
-        # )
+        log(
+            task="updatePublishedMsgDaily",
+            function="main",
+            message="更新公众号文章信息任务正常执行"
+        )