cobweb-launcher 1.2.5__py3-none-any.whl → 1.2.6__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.

Potentially problematic release.


This version of cobweb-launcher might be problematic. Click here for more details.

@@ -86,7 +86,7 @@ class Crawler(threading.Thread):
86
86
  time.sleep(1)
87
87
  continue
88
88
 
89
- elif seed.params.retry >= self.max_retries:
89
+ elif seed.params.retry > self.max_retries:
90
90
  seed.params.seed_status = DealModel.fail
91
91
  self._done.push(seed)
92
92
  continue
@@ -79,8 +79,8 @@ class Launcher(threading.Thread):
79
79
  self._done_queue_max_size = setting.DONE_QUEUE_MAX_SIZE
80
80
  self._upload_queue_max_size = setting.UPLOAD_QUEUE_MAX_SIZE
81
81
 
82
- self._spider_thread_num = setting.SPIDER_MAX_RETRIES
83
- self._spider_max_retries = setting.SPIDER_THREAD_NUM
82
+ self._spider_max_retries = setting.SPIDER_MAX_RETRIES
83
+ self._spider_thread_num = setting.SPIDER_THREAD_NUM
84
84
 
85
85
  self._done_model = setting.DONE_MODEL
86
86
  self._task_model = setting.TASK_MODEL
@@ -36,31 +36,27 @@ class LauncherPro(Launcher):
36
36
  def _execute_heartbeat(self):
37
37
  while not self._stop.is_set():
38
38
  if self._heartbeat_start_event.is_set():
39
- self._db.setex(self._heartbeat_key, 3)
40
- time.sleep(2)
39
+ self._db.setex(self._heartbeat_key, 5)
40
+ time.sleep(3)
41
41
 
42
42
  def _reset(self):
43
43
  """
44
44
  检查过期种子,重新添加到redis缓存中
45
45
  """
46
- init = True
47
46
  while not self._pause.is_set():
48
47
  reset_wait_seconds = 30
49
- start_reset_time = int(time.time())
50
48
  if self._db.lock(self._reset_lock_key, t=120):
51
- if not self.heartbeat:
52
- self._heartbeat_start_event.set()
53
49
 
54
50
  _min = -int(time.time()) + self._seed_reset_seconds \
55
- if self.heartbeat or not init else "-inf"
51
+ if self.heartbeat else "-inf"
56
52
 
57
53
  self._db.members(self._todo_key, 0, _min=_min, _max="(0")
58
54
  self._db.delete(self._reset_lock_key)
59
55
 
60
- ttl = 120 - int(time.time()) + start_reset_time
61
- reset_wait_seconds = max(ttl, 1)
56
+ if not self.heartbeat:
57
+ self._heartbeat_start_event.set()
58
+
62
59
  time.sleep(reset_wait_seconds)
63
- init = False
64
60
 
65
61
  def _scheduler(self):
66
62
  """
@@ -111,7 +107,7 @@ class LauncherPro(Launcher):
111
107
  refresh_time = int(time.time())
112
108
  seeds = {k:-refresh_time - v / 1000 for k, v in self.__DOING__.items()}
113
109
  self._db.zadd(self._todo_key, item=seeds, xx=True)
114
- time.sleep(30)
110
+ time.sleep(15)
115
111
 
116
112
  def _delete(self):
117
113
  """
cobweb/setting.py CHANGED
@@ -45,7 +45,7 @@ TODO_QUEUE_FULL_WAIT_SECONDS = 5 # todo队列已满时等待时间
45
45
  NEW_QUEUE_WAIT_SECONDS = 30 # new队列等待时间
46
46
  DONE_QUEUE_WAIT_SECONDS = 15 # done队列等待时间
47
47
  UPLOAD_QUEUE_WAIT_SECONDS = 15 # upload队列等待时间
48
- SEED_RESET_SECONDS = 300 # 种子重制时间
48
+ SEED_RESET_SECONDS = 30 # 种子重制时间
49
49
 
50
50
 
51
51
  # Launcher 队列长度
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cobweb-launcher
3
- Version: 1.2.5
3
+ Version: 1.2.6
4
4
  Summary: spider_hole
5
5
  Home-page: https://github.com/Juannie-PP/cobweb
6
6
  Author: Juannie-PP
@@ -1,6 +1,6 @@
1
1
  cobweb/__init__.py,sha256=uMHyf4Fekbyw2xBCbkA8R0LwCpBJf5p_7pWbh60ZWYk,83
2
2
  cobweb/constant.py,sha256=zy3XYsc1qp2B76_Fn_hVQ8eGHlPBd3OFlZK2cryE6FY,2839
3
- cobweb/setting.py,sha256=_t3LMSpxUNR4dVD9Tox22W9omHPvjeWABFzpgkEOoH0,2016
3
+ cobweb/setting.py,sha256=bKM2J-yjGHeQn1Yf-yZ3cay_FTCPaokgOYSC6GPWwM4,2015
4
4
  cobweb/base/__init__.py,sha256=4gwWWQ0Q8cYG9cD7Lwf4XMqRGc5M_mapS3IczR6zeCE,222
5
5
  cobweb/base/common_queue.py,sha256=W7PPZZFl52j3Mc916T0imHj7oAUelA6aKJwW-FecDPE,872
6
6
  cobweb/base/decorators.py,sha256=wDCaQ94aAZGxks9Ljc0aXq6omDXT1_yzFy83ZW6VbVI,930
@@ -11,16 +11,16 @@ cobweb/base/response.py,sha256=eB1DWMXFCpn3cJ3yzgCRU1WeZAdayGDohRgdjdMUFN4,406
11
11
  cobweb/base/seed.py,sha256=Uz_VBRlAxNYQcFHk3tsZFMlU96yPOedHaWGTvk-zKd8,2908
12
12
  cobweb/crawlers/__init__.py,sha256=msvkB9mTpsgyj8JfNMsmwAcpy5kWk_2NrO1Adw2Hkw0,29
13
13
  cobweb/crawlers/base_crawler.py,sha256=ee_WSDnPQpPTk6wlFuY2UEx5L3hcsAZFcr6i3GLSry8,5751
14
- cobweb/crawlers/crawler.py,sha256=_4bU4rlg-oQTztWibtAEKY4nzFxpZ-FBu6KuwhEkewE,6003
14
+ cobweb/crawlers/crawler.py,sha256=MJ2rFTrVjQ4Q9TmX0dpbOvT4tdokQwh7dKeFY_W7pPE,6002
15
15
  cobweb/crawlers/file_crawler.py,sha256=2Sjbdgxzqd41WykKUQE3QQlGai3T8k-pmHNmPlTchjQ,4454
16
16
  cobweb/db/__init__.py,sha256=ut0iEyBLjcJL06WNG_5_d4hO5PJWvDrKWMkDOdmgh2M,30
17
17
  cobweb/db/redis_db.py,sha256=NNI2QkRV1hEZI-z-COEncXt88z3pZN6wusKlcQzc8V4,4304
18
18
  cobweb/exceptions/__init__.py,sha256=E9SHnJBbhD7fOgPFMswqyOf8SKRDrI_i25L0bSpohvk,32
19
19
  cobweb/exceptions/oss_db_exception.py,sha256=iP_AImjNHT3-Iv49zCFQ3rdLnlvuHa3h2BXApgrOYpA,636
20
20
  cobweb/launchers/__init__.py,sha256=af0Y6wrGX8SQZ7w7XL2sOtREjCT3dwad-uCc3nIontY,76
21
- cobweb/launchers/launcher.py,sha256=Mepg-hv9YL5_VnY_Mwqxzd8ZRGyK8gxsl_5B_Ibz0Uc,5466
21
+ cobweb/launchers/launcher.py,sha256=0YhJtmN048MgTZ7SAUWvaKJEPXrNx0p4dkoTopsyjzc,5466
22
22
  cobweb/launchers/launcher_air.py,sha256=zHVEJqQCxYU1WDnqQzzEHbEXasR1GmKevujQkCfFt5o,2947
23
- cobweb/launchers/launcher_pro.py,sha256=g0aqlUSmgU4o7F9bQ_oYrdlqn8w71wcIS93t1NvzxBg,8324
23
+ cobweb/launchers/launcher_pro.py,sha256=qCmobbi1jhI09cVRjaYGxyTHwBSvARiHxF1p37b5iaE,8107
24
24
  cobweb/pipelines/__init__.py,sha256=zSUsGtx6smbs2iXBXvYynReKSgky-3gjqaAtKVnA_OU,105
25
25
  cobweb/pipelines/base_pipeline.py,sha256=fYnWf79GmhufXpcnMa3te18SbmnVeYLwxfyo-zLd9CY,1577
26
26
  cobweb/pipelines/loghub_pipeline.py,sha256=cjPO6w6UJ0jNw2fVvdX0BCdlm58T7dmYXlxzXOBpvfY,1027
@@ -30,8 +30,8 @@ cobweb/pipelines/pipeline_loghub.py,sha256=xZ6D55BGdiM71WUv83jyLGbEyUwhBHLJRZoXt
30
30
  cobweb/utils/__init__.py,sha256=JTE4sBfHnKHhD6w9Auk0MIT7O9BMOamCeryhlHNx3Zg,47
31
31
  cobweb/utils/oss.py,sha256=gyt8-UB07tVphZLQXMOf-JTJwU-mWq8KZkOXKkAf3uk,3513
32
32
  cobweb/utils/tools.py,sha256=5JEaaAwYoV9Sdla2UBIJn6faUBuXmxUMagm9ck6FVqs,1253
33
- cobweb_launcher-1.2.5.dist-info/LICENSE,sha256=z1rxSIGOyzcSb3orZxFPxzx-0C1vTocmswqBNxpKfEk,1063
34
- cobweb_launcher-1.2.5.dist-info/METADATA,sha256=-1P8DAthZeUuTBjWMQDUG0GmVIctOEGM4dc3Kh175-8,6489
35
- cobweb_launcher-1.2.5.dist-info/WHEEL,sha256=ewwEueio1C2XeHTvT17n8dZUJgOvyCWCt0WVNLClP9o,92
36
- cobweb_launcher-1.2.5.dist-info/top_level.txt,sha256=4GETBGNsKqiCUezmT-mJn7tjhcDlu7nLIV5gGgHBW4I,7
37
- cobweb_launcher-1.2.5.dist-info/RECORD,,
33
+ cobweb_launcher-1.2.6.dist-info/LICENSE,sha256=z1rxSIGOyzcSb3orZxFPxzx-0C1vTocmswqBNxpKfEk,1063
34
+ cobweb_launcher-1.2.6.dist-info/METADATA,sha256=q_ihYp0LYgZRMdvzJ2gmTYG0HgeoOAnRjOEj5FAUp34,6489
35
+ cobweb_launcher-1.2.6.dist-info/WHEEL,sha256=ewwEueio1C2XeHTvT17n8dZUJgOvyCWCt0WVNLClP9o,92
36
+ cobweb_launcher-1.2.6.dist-info/top_level.txt,sha256=4GETBGNsKqiCUezmT-mJn7tjhcDlu7nLIV5gGgHBW4I,7
37
+ cobweb_launcher-1.2.6.dist-info/RECORD,,