cobweb-launcher 1.2.2__py3-none-any.whl → 1.2.3__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/launchers/launcher.py +0 -1
- cobweb/launchers/launcher_pro.py +14 -3
- {cobweb_launcher-1.2.2.dist-info → cobweb_launcher-1.2.3.dist-info}/METADATA +1 -1
- {cobweb_launcher-1.2.2.dist-info → cobweb_launcher-1.2.3.dist-info}/RECORD +7 -7
- {cobweb_launcher-1.2.2.dist-info → cobweb_launcher-1.2.3.dist-info}/LICENSE +0 -0
- {cobweb_launcher-1.2.2.dist-info → cobweb_launcher-1.2.3.dist-info}/WHEEL +0 -0
- {cobweb_launcher-1.2.2.dist-info → cobweb_launcher-1.2.3.dist-info}/top_level.txt +0 -0
cobweb/launchers/launcher.py
CHANGED
cobweb/launchers/launcher_pro.py
CHANGED
|
@@ -16,6 +16,8 @@ class LauncherPro(Launcher):
|
|
|
16
16
|
self._fail_key = "{%s:%s}:fail" % (project, task)
|
|
17
17
|
self._heartbeat_key = "heartbeat:%s_%s" % (project, task)
|
|
18
18
|
self._reset_lock_key = "lock:reset:%s_%s" % (project, task)
|
|
19
|
+
self._statistics_done_key = "{%s:%s}:statistics:done" % (project, task)
|
|
20
|
+
self._statistics_fail_key = "{%s:%s}:statistics:fail" % (project, task)
|
|
19
21
|
self._db = RedisDB()
|
|
20
22
|
|
|
21
23
|
self._heartbeat_start_event = threading.Event()
|
|
@@ -25,6 +27,12 @@ class LauncherPro(Launcher):
|
|
|
25
27
|
def heartbeat(self):
|
|
26
28
|
return self._db.exists(self._heartbeat_key)
|
|
27
29
|
|
|
30
|
+
def statistics(self, key, count, expire_time):
|
|
31
|
+
if self._db.exists(key):
|
|
32
|
+
self._db._client.incrby(key, count)
|
|
33
|
+
else:
|
|
34
|
+
self._db.setex(key, expire_time, int(count))
|
|
35
|
+
|
|
28
36
|
def _execute_heartbeat(self):
|
|
29
37
|
while not self._stop.is_set():
|
|
30
38
|
if self._heartbeat_start_event.is_set():
|
|
@@ -124,13 +132,16 @@ class LauncherPro(Launcher):
|
|
|
124
132
|
else:
|
|
125
133
|
seeds.append(seed.to_string)
|
|
126
134
|
if seeds:
|
|
127
|
-
self._db.zrem(self._todo_key, *seeds)
|
|
135
|
+
count = self._db.zrem(self._todo_key, *seeds)
|
|
136
|
+
self.statistics(self._statistics_done_key, count, 86400 * 30)
|
|
128
137
|
self._remove_doing_seeds(seeds)
|
|
129
138
|
if s_seeds:
|
|
130
|
-
self._db.done([self._todo_key, self._done_key], *s_seeds)
|
|
139
|
+
count = self._db.done([self._todo_key, self._done_key], *s_seeds)
|
|
140
|
+
self.statistics(self._statistics_done_key, count, 86400 * 30)
|
|
131
141
|
self._remove_doing_seeds(s_seeds)
|
|
132
142
|
if f_seeds:
|
|
133
|
-
self._db.done([self._todo_key, self._fail_key], *f_seeds)
|
|
143
|
+
count = self._db.done([self._todo_key, self._fail_key], *f_seeds)
|
|
144
|
+
self.statistics(self._statistics_fail_key, count, 86400 * 30)
|
|
134
145
|
self._remove_doing_seeds(f_seeds)
|
|
135
146
|
|
|
136
147
|
if status:
|
|
@@ -18,9 +18,9 @@ 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=
|
|
21
|
+
cobweb/launchers/launcher.py,sha256=W2CdS6-tYL0queyT51g__EoQfwsBxE0Z4wEQzuONe6Q,5424
|
|
22
22
|
cobweb/launchers/launcher_air.py,sha256=zHVEJqQCxYU1WDnqQzzEHbEXasR1GmKevujQkCfFt5o,2947
|
|
23
|
-
cobweb/launchers/launcher_pro.py,sha256=
|
|
23
|
+
cobweb/launchers/launcher_pro.py,sha256=uu_5S9rzgv0psDr8tYijuWcPQUSiVCcrzWtd6QDPiYY,8349
|
|
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.
|
|
34
|
-
cobweb_launcher-1.2.
|
|
35
|
-
cobweb_launcher-1.2.
|
|
36
|
-
cobweb_launcher-1.2.
|
|
37
|
-
cobweb_launcher-1.2.
|
|
33
|
+
cobweb_launcher-1.2.3.dist-info/LICENSE,sha256=z1rxSIGOyzcSb3orZxFPxzx-0C1vTocmswqBNxpKfEk,1063
|
|
34
|
+
cobweb_launcher-1.2.3.dist-info/METADATA,sha256=YzkV8mWy2OVcj36NSo3N_Im-r8dvSfu5-K2_B43VcuA,6489
|
|
35
|
+
cobweb_launcher-1.2.3.dist-info/WHEEL,sha256=ewwEueio1C2XeHTvT17n8dZUJgOvyCWCt0WVNLClP9o,92
|
|
36
|
+
cobweb_launcher-1.2.3.dist-info/top_level.txt,sha256=4GETBGNsKqiCUezmT-mJn7tjhcDlu7nLIV5gGgHBW4I,7
|
|
37
|
+
cobweb_launcher-1.2.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|