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

cobweb/base/request.py CHANGED
@@ -70,3 +70,13 @@ class Request:
70
70
  response.raise_for_status()
71
71
  return response
72
72
 
73
+ @property
74
+ def to_dict(self):
75
+ _dict = self.__dict__.copy()
76
+ _dict.pop('url')
77
+ _dict.pop('seed')
78
+ _dict.pop('check_status_code')
79
+ _dict.pop('request_setting')
80
+ return _dict
81
+
82
+
@@ -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.8
3
+ Version: 1.1.0
4
4
  Summary: spider_hole
5
5
  Home-page: https://github.com/Juannie-PP/cobweb
6
6
  Author: Juannie-PP
@@ -1,32 +1,32 @@
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
7
7
  cobweb/base/item.py,sha256=pMriHStzUXtSvIf5Z3KXsP-bCvjlG1gM3z33wWeuoH8,966
8
8
  cobweb/base/log.py,sha256=L01hXdk3L2qEm9X1FOXQ9VmWIoHSELe0cyZvrdAN61A,2003
9
- cobweb/base/request.py,sha256=b08AtUSZjlFLEFIEw5uGS__FjU6QSldL20-UjZD0LbI,2128
9
+ 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=XfPBNUynhgAfsy1iUPztEZxDckb-J8pAAzPl3yHvHp8,4947
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.8.dist-info/LICENSE,sha256=z1rxSIGOyzcSb3orZxFPxzx-0C1vTocmswqBNxpKfEk,1063
29
- cobweb_launcher-1.0.8.dist-info/METADATA,sha256=XxTFgYdij-0ct7QV4cqz8Tg4b7JhoOWQ3j_K1_SplEc,1245
30
- cobweb_launcher-1.0.8.dist-info/WHEEL,sha256=ewwEueio1C2XeHTvT17n8dZUJgOvyCWCt0WVNLClP9o,92
31
- cobweb_launcher-1.0.8.dist-info/top_level.txt,sha256=4GETBGNsKqiCUezmT-mJn7tjhcDlu7nLIV5gGgHBW4I,7
32
- cobweb_launcher-1.0.8.dist-info/RECORD,,
28
+ cobweb_launcher-1.1.0.dist-info/LICENSE,sha256=z1rxSIGOyzcSb3orZxFPxzx-0C1vTocmswqBNxpKfEk,1063
29
+ cobweb_launcher-1.1.0.dist-info/METADATA,sha256=065j6XHClBVaoWnQEsflJ71bSLFbM-BF5sd4TxTDvEQ,1245
30
+ cobweb_launcher-1.1.0.dist-info/WHEEL,sha256=ewwEueio1C2XeHTvT17n8dZUJgOvyCWCt0WVNLClP9o,92
31
+ cobweb_launcher-1.1.0.dist-info/top_level.txt,sha256=4GETBGNsKqiCUezmT-mJn7tjhcDlu7nLIV5gGgHBW4I,7
32
+ cobweb_launcher-1.1.0.dist-info/RECORD,,