cobweb-launcher 3.1.23__py3-none-any.whl → 3.1.24__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.
- cobweb/launchers/uploader.py +13 -30
- cobweb/schedulers/scheduler_with_redis.py +2 -1
- {cobweb_launcher-3.1.23.dist-info → cobweb_launcher-3.1.24.dist-info}/METADATA +1 -1
- {cobweb_launcher-3.1.23.dist-info → cobweb_launcher-3.1.24.dist-info}/RECORD +7 -7
- {cobweb_launcher-3.1.23.dist-info → cobweb_launcher-3.1.24.dist-info}/LICENSE +0 -0
- {cobweb_launcher-3.1.23.dist-info → cobweb_launcher-3.1.24.dist-info}/WHEEL +0 -0
- {cobweb_launcher-3.1.23.dist-info → cobweb_launcher-3.1.24.dist-info}/top_level.txt +0 -0
cobweb/launchers/uploader.py
CHANGED
@@ -39,45 +39,28 @@ class Uploader(threading.Thread):
|
|
39
39
|
|
40
40
|
@check_pause
|
41
41
|
def upload_data(self):
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
42
|
+
try:
|
43
|
+
data_info, task_ids = dict(), set()
|
44
|
+
if task_list := self.task_queue.get_task_by_status(
|
45
|
+
status=Status.UPLOAD, limit=self.upload_size
|
46
|
+
):
|
47
47
|
for task_item in task_list:
|
48
48
|
upload_data = self.pipeline.build(task_item.data)
|
49
49
|
data_info.setdefault(task_item.data.table, []).append(upload_data)
|
50
|
+
task_ids.add(task_item.task_id)
|
50
51
|
|
51
52
|
for table, datas in data_info.items():
|
52
53
|
try:
|
53
54
|
self.pipeline.upload(table, datas)
|
54
55
|
except Exception as e:
|
55
56
|
logger.info(e)
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
# try:
|
64
|
-
# for _ in range(self.upload_size):
|
65
|
-
# item = self.upload.pop()
|
66
|
-
# if not item:
|
67
|
-
# break
|
68
|
-
# # seeds.append(item.seed)
|
69
|
-
# data = self.pipeline.build(item)
|
70
|
-
# data_info.setdefault(item.table, []).append(data)
|
71
|
-
# for table, datas in data_info.items():
|
72
|
-
# try:
|
73
|
-
# self.pipeline.upload(table, datas)
|
74
|
-
# # TODO: 上传打点
|
75
|
-
# except Exception as e:
|
76
|
-
# logger.info(e)
|
77
|
-
# except Exception as e:
|
78
|
-
# logger.info(e)
|
79
|
-
# if self.upload.length < self.upload_size:
|
80
|
-
# time.sleep(self.wait_seconds)
|
57
|
+
|
58
|
+
self.task_queue.remove(task_ids)
|
59
|
+
except Exception as e:
|
60
|
+
logger.info(e)
|
61
|
+
|
62
|
+
if self.task_queue.status_length(status=Status.UPLOAD) < self.upload_size:
|
63
|
+
time.sleep(self.wait_seconds)
|
81
64
|
|
82
65
|
def run(self):
|
83
66
|
self.callback_register(self.upload_data, tag="Uploader")
|
@@ -52,7 +52,8 @@ class RedisScheduler(Scheduler):
|
|
52
52
|
time.sleep(self.scheduler_wait_seconds)
|
53
53
|
return
|
54
54
|
|
55
|
-
if self.task_queue.status_length(Status.PENDING) >= self.todo_queue_size
|
55
|
+
if self.task_queue.status_length(Status.PENDING) >= self.todo_queue_size\
|
56
|
+
or self.task_queue.length() > 5 * self.todo_queue_size:
|
56
57
|
time.sleep(self.todo_queue_full_wait_seconds)
|
57
58
|
return
|
58
59
|
|
@@ -19,22 +19,22 @@ cobweb/exceptions/oss_db_exception.py,sha256=iP_AImjNHT3-Iv49zCFQ3rdLnlvuHa3h2BX
|
|
19
19
|
cobweb/launchers/__init__.py,sha256=6_v2jd2sgj6YnOB1nPKiYBskuXVb5xpQnq2YaDGJgQ8,100
|
20
20
|
cobweb/launchers/distributor.py,sha256=I5QBs2hFiyGGkqLLkMw9uzf4_oRW2JvahNW9yc866cc,6748
|
21
21
|
cobweb/launchers/launcher.py,sha256=Shb6o6MAM38d32ybW2gY6qpGmhuiV7jo9TDh0f7rud8,5694
|
22
|
-
cobweb/launchers/uploader.py,sha256=
|
22
|
+
cobweb/launchers/uploader.py,sha256=QwJOmG7jq2T5sRzrT386zJ0YYNz-hAv0i6GOpoEaRdU,2075
|
23
23
|
cobweb/pipelines/__init__.py,sha256=rtkaaCZ4u1XcxpkDLHztETQjEcLZ_6DXTHjdfcJlyxQ,97
|
24
24
|
cobweb/pipelines/pipeline.py,sha256=OgSEZ2DdqofpZcer1Wj1tuBqn8OHVjrYQ5poqt75czQ,357
|
25
25
|
cobweb/pipelines/pipeline_csv.py,sha256=TFqxqgVUqkBF6Jott4zd6fvCSxzG67lpafRQtXPw1eg,807
|
26
26
|
cobweb/pipelines/pipeline_loghub.py,sha256=zwIa_pcWBB2UNGd32Cu-i1jKGNruTbo2STdxl1WGwZ0,1829
|
27
27
|
cobweb/schedulers/__init__.py,sha256=LEya11fdAv0X28YzbQTeC1LQZ156Fj4cyEMGqQHUWW0,49
|
28
28
|
cobweb/schedulers/scheduler.py,sha256=Of-BjbBh679R6glc12Kc8iugeERCSusP7jolpCc1UMI,1740
|
29
|
-
cobweb/schedulers/scheduler_with_redis.py,sha256=
|
29
|
+
cobweb/schedulers/scheduler_with_redis.py,sha256=dafg8jllatBiTz8J-qjTo80Xw80jkdHFW-wKoyaH7G0,7221
|
30
30
|
cobweb/utils/__init__.py,sha256=TRFJyyBjaQH_sejU6G_msOeHpjc3ZXU0dUOO5GQfknM,171
|
31
31
|
cobweb/utils/bloom.py,sha256=A8xqtHXp7jgRoBuUlpovmq8lhU5y7IEF0FOCjfQDb6s,1855
|
32
32
|
cobweb/utils/decorators.py,sha256=ZwVQlz-lYHgXgKf9KRCp15EWPzTDdhoikYUNUCIqNeM,1140
|
33
33
|
cobweb/utils/dotting.py,sha256=L-jGSApdnFIP4jUWH6p5qIme0aJ1vyDrxAx8wOJWvcs,1960
|
34
34
|
cobweb/utils/oss.py,sha256=wmToIIVNO8nCQVRmreVaZejk01aCWS35e1NV6cr0yGI,4192
|
35
35
|
cobweb/utils/tools.py,sha256=14TCedqt07m4z6bCnFAsITOFixeGr8V3aOKk--L7Cr0,879
|
36
|
-
cobweb_launcher-3.1.
|
37
|
-
cobweb_launcher-3.1.
|
38
|
-
cobweb_launcher-3.1.
|
39
|
-
cobweb_launcher-3.1.
|
40
|
-
cobweb_launcher-3.1.
|
36
|
+
cobweb_launcher-3.1.24.dist-info/LICENSE,sha256=z1rxSIGOyzcSb3orZxFPxzx-0C1vTocmswqBNxpKfEk,1063
|
37
|
+
cobweb_launcher-3.1.24.dist-info/METADATA,sha256=THQpa-rStFvhQNEMWq392PlRrPH_hxDDf1_-c5lFIGA,5998
|
38
|
+
cobweb_launcher-3.1.24.dist-info/WHEEL,sha256=ewwEueio1C2XeHTvT17n8dZUJgOvyCWCt0WVNLClP9o,92
|
39
|
+
cobweb_launcher-3.1.24.dist-info/top_level.txt,sha256=4GETBGNsKqiCUezmT-mJn7tjhcDlu7nLIV5gGgHBW4I,7
|
40
|
+
cobweb_launcher-3.1.24.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|