cobweb-launcher 3.1.14__py3-none-any.whl → 3.1.16__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.
@@ -68,9 +68,12 @@ class Scheduler(ABC, threading.Thread):
68
68
  def remove_working_items(self, items: list[str] = None):
69
69
  if not items:
70
70
  return
71
- with self.lock:
72
- for item in items:
73
- self.__WORKING_ITEMS__.pop(item, None)
71
+ for _ in range(5):
72
+ with self.lock:
73
+ for item in items:
74
+ self.__WORKING_ITEMS__.pop(item, None)
75
+ return True
76
+ time.sleep(1)
74
77
 
75
78
  def get_working_items_count(self) -> int:
76
79
  with self.lock:
@@ -109,11 +109,13 @@ class RedisScheduler(Scheduler):
109
109
  """
110
110
  删除队列种子,根据状态添加至成功或失败队列,移除doing字典种子索引
111
111
  """
112
- seeds = [seed.to_string for seed in self.done.iter_items(limit=self.done_queue_max_size)]
112
+ seeds = [seed for seed in self.done.iter_items(limit=self.done_queue_max_size)]
113
+ items = [seed.to_string for seed in seeds]
113
114
 
114
- if seeds:
115
- self.db.zrem(name=self.todo_key, *seeds)
116
- self.remove_working_items(seeds)
115
+ if self.remove_working_items(items):
116
+ self.db.zrem(self.todo_key, *items)
117
+ else:
118
+ self.done.push(seeds)
117
119
 
118
120
  if self.done.length < self.done_queue_max_size:
119
121
  time.sleep(self.done_queue_wait_seconds)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cobweb-launcher
3
- Version: 3.1.14
3
+ Version: 3.1.16
4
4
  Summary: spider_hole
5
5
  Home-page: https://github.com/Juannie-PP/cobweb
6
6
  Author: Juannie-PP
@@ -24,16 +24,16 @@ cobweb/pipelines/pipeline.py,sha256=OgSEZ2DdqofpZcer1Wj1tuBqn8OHVjrYQ5poqt75czQ,
24
24
  cobweb/pipelines/pipeline_csv.py,sha256=TFqxqgVUqkBF6Jott4zd6fvCSxzG67lpafRQtXPw1eg,807
25
25
  cobweb/pipelines/pipeline_loghub.py,sha256=zwIa_pcWBB2UNGd32Cu-i1jKGNruTbo2STdxl1WGwZ0,1829
26
26
  cobweb/schedulers/__init__.py,sha256=LEya11fdAv0X28YzbQTeC1LQZ156Fj4cyEMGqQHUWW0,49
27
- cobweb/schedulers/scheduler.py,sha256=sFlxQY-ehd-Lbskvr21v0wjkb88bs551djAY96Bz1Qs,2777
28
- cobweb/schedulers/scheduler_with_redis.py,sha256=x68CVJqcMkoUD5_AraG7lcJ6M1UdMCjt1e3i1K8Ea40,6286
27
+ cobweb/schedulers/scheduler.py,sha256=v1GIAwdxBjSLNugwVsfrh_zn_V887x02BxhVr5O8Xyo,2870
28
+ cobweb/schedulers/scheduler_with_redis.py,sha256=VW6umnyfFeExd7c_v5e--QZEQ-bWSIlHIxz7ySVkLGU,6352
29
29
  cobweb/utils/__init__.py,sha256=TRFJyyBjaQH_sejU6G_msOeHpjc3ZXU0dUOO5GQfknM,171
30
30
  cobweb/utils/bloom.py,sha256=A8xqtHXp7jgRoBuUlpovmq8lhU5y7IEF0FOCjfQDb6s,1855
31
31
  cobweb/utils/decorators.py,sha256=ZwVQlz-lYHgXgKf9KRCp15EWPzTDdhoikYUNUCIqNeM,1140
32
32
  cobweb/utils/dotting.py,sha256=L-jGSApdnFIP4jUWH6p5qIme0aJ1vyDrxAx8wOJWvcs,1960
33
33
  cobweb/utils/oss.py,sha256=wmToIIVNO8nCQVRmreVaZejk01aCWS35e1NV6cr0yGI,4192
34
34
  cobweb/utils/tools.py,sha256=14TCedqt07m4z6bCnFAsITOFixeGr8V3aOKk--L7Cr0,879
35
- cobweb_launcher-3.1.14.dist-info/LICENSE,sha256=z1rxSIGOyzcSb3orZxFPxzx-0C1vTocmswqBNxpKfEk,1063
36
- cobweb_launcher-3.1.14.dist-info/METADATA,sha256=OX4pI6FO7KD_XCkpBj2efE674q2E2PVpem_Xnaq2Z_0,5998
37
- cobweb_launcher-3.1.14.dist-info/WHEEL,sha256=ewwEueio1C2XeHTvT17n8dZUJgOvyCWCt0WVNLClP9o,92
38
- cobweb_launcher-3.1.14.dist-info/top_level.txt,sha256=4GETBGNsKqiCUezmT-mJn7tjhcDlu7nLIV5gGgHBW4I,7
39
- cobweb_launcher-3.1.14.dist-info/RECORD,,
35
+ cobweb_launcher-3.1.16.dist-info/LICENSE,sha256=z1rxSIGOyzcSb3orZxFPxzx-0C1vTocmswqBNxpKfEk,1063
36
+ cobweb_launcher-3.1.16.dist-info/METADATA,sha256=CxdyN7vkyoMCAhJpBuvEwPBBq4v7jg4Nw8p3mGnVEQs,5998
37
+ cobweb_launcher-3.1.16.dist-info/WHEEL,sha256=ewwEueio1C2XeHTvT17n8dZUJgOvyCWCt0WVNLClP9o,92
38
+ cobweb_launcher-3.1.16.dist-info/top_level.txt,sha256=4GETBGNsKqiCUezmT-mJn7tjhcDlu7nLIV5gGgHBW4I,7
39
+ cobweb_launcher-3.1.16.dist-info/RECORD,,