cobweb-launcher 1.2.4__tar.gz → 1.2.6__tar.gz
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-launcher-1.2.4/cobweb_launcher.egg-info → cobweb-launcher-1.2.6}/PKG-INFO +1 -1
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/crawlers/crawler.py +1 -1
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/launchers/launcher.py +3 -2
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/launchers/launcher_pro.py +7 -11
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/setting.py +1 -1
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6/cobweb_launcher.egg-info}/PKG-INFO +1 -1
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/setup.py +1 -1
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/LICENSE +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/README.md +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/__init__.py +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/base/__init__.py +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/base/common_queue.py +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/base/decorators.py +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/base/item.py +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/base/log.py +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/base/request.py +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/base/response.py +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/base/seed.py +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/constant.py +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/crawlers/__init__.py +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/db/__init__.py +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/db/redis_db.py +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/exceptions/__init__.py +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/exceptions/oss_db_exception.py +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/launchers/__init__.py +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/launchers/launcher_air.py +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/pipelines/__init__.py +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/pipelines/pipeline.py +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/pipelines/pipeline_console.py +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/pipelines/pipeline_loghub.py +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/utils/__init__.py +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/utils/oss.py +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb/utils/tools.py +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb_launcher.egg-info/SOURCES.txt +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb_launcher.egg-info/dependency_links.txt +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb_launcher.egg-info/requires.txt +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb_launcher.egg-info/top_level.txt +0 -0
- {cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/setup.cfg +0 -0
|
@@ -40,6 +40,7 @@ class Launcher(threading.Thread):
|
|
|
40
40
|
self.task = task
|
|
41
41
|
self.project = project
|
|
42
42
|
|
|
43
|
+
self._app_time = int(time.time())
|
|
43
44
|
self._stop = threading.Event() # 结束事件
|
|
44
45
|
self._pause = threading.Event() # 暂停事件
|
|
45
46
|
|
|
@@ -78,8 +79,8 @@ class Launcher(threading.Thread):
|
|
|
78
79
|
self._done_queue_max_size = setting.DONE_QUEUE_MAX_SIZE
|
|
79
80
|
self._upload_queue_max_size = setting.UPLOAD_QUEUE_MAX_SIZE
|
|
80
81
|
|
|
81
|
-
self.
|
|
82
|
-
self.
|
|
82
|
+
self._spider_max_retries = setting.SPIDER_MAX_RETRIES
|
|
83
|
+
self._spider_thread_num = setting.SPIDER_THREAD_NUM
|
|
83
84
|
|
|
84
85
|
self._done_model = setting.DONE_MODEL
|
|
85
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,
|
|
40
|
-
time.sleep(
|
|
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
|
|
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
|
-
|
|
61
|
-
|
|
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(
|
|
110
|
+
time.sleep(15)
|
|
115
111
|
|
|
116
112
|
def _delete(self):
|
|
117
113
|
"""
|
|
@@ -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 =
|
|
48
|
+
SEED_RESET_SECONDS = 30 # 种子重制时间
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
# Launcher 队列长度
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cobweb-launcher-1.2.4 → cobweb-launcher-1.2.6}/cobweb_launcher.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|