cobweb-launcher 1.2.62__py3-none-any.whl → 1.2.64__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49,8 +49,11 @@ class LauncherApi(Launcher):
49
49
  if (self._speed_control and self.__LAUNCHER_QUEUE__["todo"].length and
50
50
  not self._db.auto_incr(self._speed_control_key, t=self._time_window, limit=self._spider_max_count)):
51
51
  expire_time = self._db.ttl(self._speed_control_key)
52
- logger.info(f"Too fast! Please wait {expire_time} seconds...")
53
- time.sleep(expire_time / 2)
52
+ if isinstance(expire_time, int) and expire_time <= -1:
53
+ self._db.delete(self._speed_control_key)
54
+ elif isinstance(expire_time, int):
55
+ logger.info(f"Too fast! Please wait {expire_time} seconds...")
56
+ time.sleep(expire_time / 2)
54
57
  return None
55
58
  seed = self.__LAUNCHER_QUEUE__["todo"].pop()
56
59
  return seed
@@ -115,11 +118,11 @@ class LauncherApi(Launcher):
115
118
  break
116
119
  seed, new_seed = seed_tuple
117
120
  new_seeds[new_seed.to_string] = new_seed.params.priority
118
- del_seeds.add(seed.to_string)
121
+ del_seeds.add(seed)
119
122
  if new_seeds:
120
123
  self._db.zadd(self._todo_key, new_seeds, nx=True)
121
124
  if del_seeds:
122
- self.__LAUNCHER_QUEUE__['done'].push(del_seeds)
125
+ self.__LAUNCHER_QUEUE__['done'].push(list(del_seeds))
123
126
  if status:
124
127
  time.sleep(self._new_queue_wait_seconds)
125
128
 
@@ -47,7 +47,7 @@ class LauncherPro(Launcher):
47
47
  spider_speed = self._db.get(self._speed_control_key)
48
48
  if int(spider_speed or 0) > self._spider_max_count:
49
49
  expire_time = self._db.ttl(self._speed_control_key)
50
- if expire_time <= -1:
50
+ if isinstance(expire_time, int) and expire_time <= -1:
51
51
  self._db.delete(self._speed_control_key)
52
52
  elif isinstance(expire_time, int):
53
53
  logger.info(f"Too fast! Please wait {expire_time} seconds...")
@@ -117,11 +117,11 @@ class LauncherPro(Launcher):
117
117
  break
118
118
  seed, new_seed = seed_tuple
119
119
  new_seeds[new_seed.to_string] = new_seed.params.priority
120
- del_seeds.add(seed.to_string)
120
+ del_seeds.add(seed)
121
121
  if new_seeds:
122
122
  self._db.zadd(self._todo_key, new_seeds, nx=True)
123
123
  if del_seeds:
124
- self.__LAUNCHER_QUEUE__['done'].push(del_seeds)
124
+ self.__LAUNCHER_QUEUE__['done'].push(list(del_seeds))
125
125
  if status:
126
126
  time.sleep(self._new_queue_wait_seconds)
127
127
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cobweb-launcher
3
- Version: 1.2.62
3
+ Version: 1.2.64
4
4
  Summary: spider_hole
5
5
  Home-page: https://github.com/Juannie-PP/cobweb
6
6
  Author: Juannie-PP
@@ -24,8 +24,8 @@ cobweb/exceptions/oss_db_exception.py,sha256=iP_AImjNHT3-Iv49zCFQ3rdLnlvuHa3h2BX
24
24
  cobweb/launchers/__init__.py,sha256=qMuVlQcjErVK67HyKFZEsXf_rfZD5ODjx1QucSCKMOM,114
25
25
  cobweb/launchers/launcher.py,sha256=aR1cnQymjQQUJe-W_dRoQTd9t3Qav9QkLDzeWW7i0xE,7921
26
26
  cobweb/launchers/launcher_air.py,sha256=qdcxq41I9zN5snEpMUUNEQNTtUiZM1Hw_3N9zu4PuAs,3058
27
- cobweb/launchers/launcher_api.py,sha256=RlWuGSb_izevqJBVlyi_D8mlUXMKReTSOHTHHMEn8FE,8453
28
- cobweb/launchers/launcher_pro.py,sha256=Jn5T89eWZafr4wGTllqrXB5IDyZ8G9hiuk7dW3Xl1VA,8395
27
+ cobweb/launchers/launcher_api.py,sha256=3-A6k3Igvi-xnvP9M_3NkJKUweDJ_pY10ZrHClteD-g,8628
28
+ cobweb/launchers/launcher_pro.py,sha256=xM2z3nCTb6gehuD1Ggyvli2knGAPjGczbjOhKWswVpo,8424
29
29
  cobweb/pipelines/__init__.py,sha256=zSUsGtx6smbs2iXBXvYynReKSgky-3gjqaAtKVnA_OU,105
30
30
  cobweb/pipelines/pipeline.py,sha256=4TJLX0sUHRxYndF5A4Vs5btUGI-wigkOcFvhTW1hLXI,2009
31
31
  cobweb/pipelines/pipeline_console.py,sha256=NEh-4zhuVAQOqwXLsqeb-rcNZ9_KXFUpL3otUTL5qBs,754
@@ -38,8 +38,8 @@ cobweb/utils/bloom.py,sha256=vng-YbKgh9HbtpAWYf_nkUSbfVTOj40aqUUejRYlsCU,1752
38
38
  cobweb/utils/dotting.py,sha256=mVICaa26R-dQ4JGmPK-kkR6QjX38QiRewXZnGb2DCIc,1784
39
39
  cobweb/utils/oss.py,sha256=6x_ugXanh1R-6ZylQzUDQh4OeFZHujhWFCOxbzy53JY,3984
40
40
  cobweb/utils/tools.py,sha256=5JEaaAwYoV9Sdla2UBIJn6faUBuXmxUMagm9ck6FVqs,1253
41
- cobweb_launcher-1.2.62.dist-info/LICENSE,sha256=z1rxSIGOyzcSb3orZxFPxzx-0C1vTocmswqBNxpKfEk,1063
42
- cobweb_launcher-1.2.62.dist-info/METADATA,sha256=fgQXgBFjxcRQdCLc4m_2qmM11V8QHleCbROVG2dPIFo,6510
43
- cobweb_launcher-1.2.62.dist-info/WHEEL,sha256=ewwEueio1C2XeHTvT17n8dZUJgOvyCWCt0WVNLClP9o,92
44
- cobweb_launcher-1.2.62.dist-info/top_level.txt,sha256=4GETBGNsKqiCUezmT-mJn7tjhcDlu7nLIV5gGgHBW4I,7
45
- cobweb_launcher-1.2.62.dist-info/RECORD,,
41
+ cobweb_launcher-1.2.64.dist-info/LICENSE,sha256=z1rxSIGOyzcSb3orZxFPxzx-0C1vTocmswqBNxpKfEk,1063
42
+ cobweb_launcher-1.2.64.dist-info/METADATA,sha256=NikLvEH211SWsw5jTUhaLsXROPJWvc2bkEUq3n4wlaM,6510
43
+ cobweb_launcher-1.2.64.dist-info/WHEEL,sha256=ewwEueio1C2XeHTvT17n8dZUJgOvyCWCt0WVNLClP9o,92
44
+ cobweb_launcher-1.2.64.dist-info/top_level.txt,sha256=4GETBGNsKqiCUezmT-mJn7tjhcDlu7nLIV5gGgHBW4I,7
45
+ cobweb_launcher-1.2.64.dist-info/RECORD,,