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

@@ -37,7 +37,7 @@ class Crawler(threading.Thread):
37
37
  @staticmethod
38
38
  def download(item: Request) -> Union[Seed, BaseItem, Response, str]:
39
39
  response = item.download()
40
- yield Response(item.seed, response)
40
+ yield Response(item.seed, response, **item.to_dict)
41
41
 
42
42
  @staticmethod
43
43
  def parse(item: Response) -> BaseItem:
@@ -54,6 +54,7 @@ class Crawler(threading.Thread):
54
54
  continue
55
55
 
56
56
  elif seed.params.retry >= self.max_retries:
57
+ seed.params.identifier = DealModel.fail
57
58
  self.launcher_queue['done'].push(seed)
58
59
  continue
59
60
 
cobweb/db/redis_db.py CHANGED
@@ -126,3 +126,4 @@ class RedisDB:
126
126
  self.execute_lua(lua_script, keys, *args)
127
127
 
128
128
 
129
+
@@ -16,7 +16,6 @@ class LauncherPro(Launcher):
16
16
  self._fail = "{%s:%s}:fail" % (project, task)
17
17
  self._heartbeat = "heartbeat:%s_%s" % (project, task)
18
18
  self._reset_lock = "lock:reset:%s_%s" % (project, task)
19
- self._heartbeat_lock = "lock:heartbeat:%s_%s" % (project, task)
20
19
  self._db = RedisDB()
21
20
 
22
21
  self._heartbeat_start_event = threading.Event()
@@ -29,10 +28,8 @@ class LauncherPro(Launcher):
29
28
  def _execute_heartbeat(self):
30
29
  while not self._stop.is_set():
31
30
  if self._heartbeat_start_event.is_set():
32
- if self._db.lock(self._heartbeat_lock, t=1):
33
- self._db.setex(self._heartbeat, 3)
34
- time.sleep(1)
35
- time.sleep(0.5)
31
+ self._db.setex(self._heartbeat, 3)
32
+ time.sleep(2)
36
33
 
37
34
  def _reset(self):
38
35
  """
cobweb/setting.py CHANGED
@@ -23,8 +23,8 @@ OSS_BUCKET = os.getenv("OSS_BUCKET")
23
23
  OSS_ENDPOINT = os.getenv("OSS_ENDPOINT")
24
24
  OSS_ACCESS_KEY = os.getenv("OSS_ACCESS_KEY")
25
25
  OSS_SECRET_KEY = os.getenv("OSS_SECRET_KEY")
26
+ OSS_CHUNK_SIZE = 10 * 1024 ** 2
26
27
  OSS_MIN_UPLOAD_SIZE = 1024
27
- OSS_CHUNK_SIZE = 1024 ** 2
28
28
 
29
29
  # 采集器选择
30
30
  CRAWLER = "cobweb.crawlers.CrawlerAir"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cobweb-launcher
3
- Version: 1.0.9
3
+ Version: 1.1.1
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=IkGcdTU6fEBNyzWowcJSSMdErntFM1kmu4WUp1BgImU,45
2
2
  cobweb/constant.py,sha256=Aw2ES_nohVRLTWylZp6WMiUAlgyw4kLbae7LpwdZ5y4,1867
3
- cobweb/setting.py,sha256=fYK8KgrZYwSoJC9ywsopAtV0mdRw0_MGAoYORgET01M,1949
3
+ cobweb/setting.py,sha256=9kiyVbFC60Wvbh2tfo52XXELYXhhJZeG5hPLhZYbHbQ,1954
4
4
  cobweb/base/__init__.py,sha256=diiK5MygQaWjlWNLbW6eUIg-93O6glMGC9WLNM5jyOc,209
5
5
  cobweb/base/common_queue.py,sha256=W7PPZZFl52j3Mc916T0imHj7oAUelA6aKJwW-FecDPE,872
6
6
  cobweb/base/decorators.py,sha256=wDCaQ94aAZGxks9Ljc0aXq6omDXT1_yzFy83ZW6VbVI,930
@@ -10,23 +10,23 @@ cobweb/base/request.py,sha256=tEkgMVUfdQI-kZuzWuiit9P_q4Q9-_RZh9aXXpc0314,2352
10
10
  cobweb/base/response.py,sha256=7h9TwCNqRlwM_fvNmid9zOoRfHbKB8ABSU0eaVUJdVo,405
11
11
  cobweb/base/seed.py,sha256=XswH16eEd6iwIBpt71E2S_AsV5UVCcOEOBFoP0r5QRo,2900
12
12
  cobweb/crawlers/__init__.py,sha256=1sMhQ0-NJxiff3IqF2aMCXkSXcJFzzoCKIayQ5go4aI,71
13
- cobweb/crawlers/base_crawler.py,sha256=snfjGYV9oZl3UnrxUcpAD9cK0n_rPeuyUYQkU1aCBrA,4891
13
+ cobweb/crawlers/base_crawler.py,sha256=YtFju88e3NIzGgYRSEIiMD-H4fPa_IDlgFxtxMiADzk,4963
14
14
  cobweb/crawlers/file_crawler.py,sha256=AeK22bakMbwDfqrITlX6ssvR2KSpHQ3s8YEuzX_Bluk,8670
15
15
  cobweb/db/__init__.py,sha256=ut0iEyBLjcJL06WNG_5_d4hO5PJWvDrKWMkDOdmgh2M,30
16
- cobweb/db/redis_db.py,sha256=XE1ebIi_4e0KBKiyPdKX7l2lSgV5vhMwEhNDlAcsccU,4247
16
+ cobweb/db/redis_db.py,sha256=uML8WWY5GVT-mVeCBL40Ip-0Bso6UHkAdn2cQueQxCg,4248
17
17
  cobweb/exceptions/__init__.py,sha256=E9SHnJBbhD7fOgPFMswqyOf8SKRDrI_i25L0bSpohvk,32
18
18
  cobweb/exceptions/oss_db_exception.py,sha256=iP_AImjNHT3-Iv49zCFQ3rdLnlvuHa3h2BXApgrOYpA,636
19
19
  cobweb/launchers/__init__.py,sha256=qwlkEJVri7dvCgi45aX3lqAmQS0HrPicAipDvH75kew,69
20
20
  cobweb/launchers/launcher.py,sha256=O6Kkvqk-0kOxJom8YO9zW18e_2eMYrA5RTS9Xy4TW5k,5665
21
- cobweb/launchers/launcher_pro.py,sha256=GlDpyP1XAY2bX5SuSBn3920D5OKNigQgLnJfu6QOmPw,6760
21
+ cobweb/launchers/launcher_pro.py,sha256=nGPnkQ6TedYNf3Liugqt8yKG48T3lNmgFd1BVptSdHw,6591
22
22
  cobweb/pipelines/__init__.py,sha256=xanY-Z1d7zRR5JhCdW2htzrAywnKBkigiaUlTFa6of0,80
23
23
  cobweb/pipelines/base_pipeline.py,sha256=fYnWf79GmhufXpcnMa3te18SbmnVeYLwxfyo-zLd9CY,1577
24
24
  cobweb/pipelines/loghub_pipeline.py,sha256=cjPO6w6UJ0jNw2fVvdX0BCdlm58T7dmYXlxzXOBpvfY,1027
25
25
  cobweb/utils/__init__.py,sha256=JTE4sBfHnKHhD6w9Auk0MIT7O9BMOamCeryhlHNx3Zg,47
26
26
  cobweb/utils/oss.py,sha256=uD5aN2oVYImit3amE6TjxWMaTAcbAh9dCnpIQhf4M9Q,3238
27
27
  cobweb/utils/tools.py,sha256=bVd3iRGBvwhohQAH7AXTTjbmQ54Z35K0O-fatEyhePU,1249
28
- cobweb_launcher-1.0.9.dist-info/LICENSE,sha256=z1rxSIGOyzcSb3orZxFPxzx-0C1vTocmswqBNxpKfEk,1063
29
- cobweb_launcher-1.0.9.dist-info/METADATA,sha256=OGtzwPd4tfBxFIU-KhjR4JPYG3sF_3Em1Av3Ah0tOCs,1245
30
- cobweb_launcher-1.0.9.dist-info/WHEEL,sha256=ewwEueio1C2XeHTvT17n8dZUJgOvyCWCt0WVNLClP9o,92
31
- cobweb_launcher-1.0.9.dist-info/top_level.txt,sha256=4GETBGNsKqiCUezmT-mJn7tjhcDlu7nLIV5gGgHBW4I,7
32
- cobweb_launcher-1.0.9.dist-info/RECORD,,
28
+ cobweb_launcher-1.1.1.dist-info/LICENSE,sha256=z1rxSIGOyzcSb3orZxFPxzx-0C1vTocmswqBNxpKfEk,1063
29
+ cobweb_launcher-1.1.1.dist-info/METADATA,sha256=bTZHpxiQt-1ZSP3div4SCSHDSUmJpLej_L7znSM1mkI,1245
30
+ cobweb_launcher-1.1.1.dist-info/WHEEL,sha256=ewwEueio1C2XeHTvT17n8dZUJgOvyCWCt0WVNLClP9o,92
31
+ cobweb_launcher-1.1.1.dist-info/top_level.txt,sha256=4GETBGNsKqiCUezmT-mJn7tjhcDlu7nLIV5gGgHBW4I,7
32
+ cobweb_launcher-1.1.1.dist-info/RECORD,,