p1-taskqueue 0.1.17__py3-none-any.whl → 0.1.19__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.
- {p1_taskqueue-0.1.17.dist-info → p1_taskqueue-0.1.19.dist-info}/METADATA +1 -1
- {p1_taskqueue-0.1.17.dist-info → p1_taskqueue-0.1.19.dist-info}/RECORD +5 -5
- taskqueue/libs/helper_test.py +7 -2
- {p1_taskqueue-0.1.17.dist-info → p1_taskqueue-0.1.19.dist-info}/WHEEL +0 -0
- {p1_taskqueue-0.1.17.dist-info → p1_taskqueue-0.1.19.dist-info}/top_level.txt +0 -0
|
@@ -3,8 +3,8 @@ taskqueue/celery_app.py,sha256=BR1wHezSOFanFwSCINnrWvjoiZTNy0o0nUe4o8RYCsI,5261
|
|
|
3
3
|
taskqueue/cmanager.py,sha256=GSW-RWsNJTFHAoL57-WRf9k1eKD58gJsiU6dlCS7Zq4,16261
|
|
4
4
|
taskqueue/slack_notifier.py,sha256=ZvTbWa1XXHUiciYF14_SH5af0BvGoPCBQohPtxx4FgU,1419
|
|
5
5
|
taskqueue/libs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
taskqueue/libs/helper_test.py,sha256=
|
|
7
|
-
p1_taskqueue-0.1.
|
|
8
|
-
p1_taskqueue-0.1.
|
|
9
|
-
p1_taskqueue-0.1.
|
|
10
|
-
p1_taskqueue-0.1.
|
|
6
|
+
taskqueue/libs/helper_test.py,sha256=NGqvOZth4yO_m5Rm0AX0U4AOKjbcfICELhj5oIkxDe8,9759
|
|
7
|
+
p1_taskqueue-0.1.19.dist-info/METADATA,sha256=LXxoGKzxrZ4Lq92cpadGx3Z8wgZZmi93gu8_aSwAiaU,1597
|
|
8
|
+
p1_taskqueue-0.1.19.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
9
|
+
p1_taskqueue-0.1.19.dist-info/top_level.txt,sha256=hA3SM1ik2K8iPqtlt_-_nJ4TAePwHPN3vsOc4EiynqU,10
|
|
10
|
+
p1_taskqueue-0.1.19.dist-info/RECORD,,
|
taskqueue/libs/helper_test.py
CHANGED
|
@@ -112,6 +112,7 @@ def celery_worker_burst(include_func_names: List[str], channel: str = "default")
|
|
|
112
112
|
def get_queued_tasks(channel: str = "default"):
|
|
113
113
|
app = current_app
|
|
114
114
|
queued_tasks = []
|
|
115
|
+
messages = []
|
|
115
116
|
|
|
116
117
|
try:
|
|
117
118
|
with app.connection_for_read() as conn:
|
|
@@ -119,10 +120,11 @@ def get_queued_tasks(channel: str = "default"):
|
|
|
119
120
|
queue = app.amqp.queues[channel](chan)
|
|
120
121
|
|
|
121
122
|
while True:
|
|
122
|
-
message = queue.get(no_ack=
|
|
123
|
+
message = queue.get(no_ack=False)
|
|
123
124
|
if not message:
|
|
124
125
|
break
|
|
125
126
|
|
|
127
|
+
messages.append(message)
|
|
126
128
|
task_name = message.headers.get("task")
|
|
127
129
|
|
|
128
130
|
try:
|
|
@@ -173,7 +175,10 @@ def get_queued_tasks(channel: str = "default"):
|
|
|
173
175
|
|
|
174
176
|
except Exception as e:
|
|
175
177
|
logger.warning(f"Failed to decode message: {e}")
|
|
176
|
-
|
|
178
|
+
|
|
179
|
+
for message in messages:
|
|
180
|
+
if message and not message.acknowledged:
|
|
181
|
+
message.reject(requeue=True)
|
|
177
182
|
|
|
178
183
|
except Exception as e:
|
|
179
184
|
logger.error(
|
|
File without changes
|
|
File without changes
|