Bläddra i källkod

抓取部分执行任务

luojunhui 6 månader sedan
förälder
incheckning
d90151ae82
1 ändrade filer med 6 tillägg och 6 borttagningar
  1. 6 6
      run_video_account_crawler.py

+ 6 - 6
run_video_account_crawler.py

@@ -20,36 +20,36 @@ def main():
     try:
     try:
         account_crawler.run()
         account_crawler.run()
     except Exception as e:
     except Exception as e:
-        traceback.print_exc()
+        error_msg = traceback.format_exc()
         bot(
         bot(
             title='账号抓取v1执行失败',
             title='账号抓取v1执行失败',
             detail={
             detail={
                 "error": str(e),
                 "error": str(e),
-                "traceback": traceback.format_exc()
+                "traceback": error_msg
             }
             }
         )
         )
     # 再执行文章抓取
     # 再执行文章抓取
     try:
     try:
         video_crawler.run()
         video_crawler.run()
     except Exception as e:
     except Exception as e:
-        traceback.print_exc()
+        error_msg = traceback.format_exc()
         bot(
         bot(
             title='视频抓取执行失败',
             title='视频抓取执行失败',
             detail={
             detail={
                 "error": str(e),
                 "error": str(e),
-                "traceback": traceback.format_exc()
+                "traceback": error_msg
             }
             }
         )
         )
     # 再执行账号抓取v2
     # 再执行账号抓取v2
     try:
     try:
         account_crawler.run_v2()
         account_crawler.run_v2()
     except Exception as e:
     except Exception as e:
-        traceback.print_exc()
+        error_msg = traceback.format_exc()
         bot(
         bot(
             title='账号抓取V2执行失败',
             title='账号抓取V2执行失败',
             detail={
             detail={
                 "error": str(e),
                 "error": str(e),
-                "traceback": traceback.format_exc()
+                "traceback": error_msg
             }
             }
         )
         )