Selaa lähdekoodia

登录添加25秒延迟

lizongze 2 vuotta sitten
vanhempi
commit
fdf926e5a7
1 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  1. 2 1
      FworkSpider/untils/cookie_pool.py

+ 2 - 1
FworkSpider/untils/cookie_pool.py

@@ -120,11 +120,12 @@ class LoginCookiePool(CookiePoolInterface):
             update_columns_value=username)
 
     @func_set_timeout(60)
-    def get_cookie(self, wait_when_null=True) -> User:
+    def get_cookie(self, wait_when_null=True, sleeptime=25) -> User:
         while True:
             try:
                 user_cookie = self._redisdb.rpoplpush(self._tab_cookie_pool)
                 if not user_cookie and wait_when_null:
+                    tools.delay_time(sleeptime)
                     log.info("暂无cookie 生产中...")
                     self.login()
                     continue