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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: p1-taskqueue
3
- Version: 0.1.17
3
+ Version: 0.1.19
4
4
  Summary: A Task Queue Wrapper for Dekoruma Backend
5
5
  Author-email: Chalvin <engineering@dekoruma.com>
6
6
  Project-URL: Homepage, https://github.com/Dekoruma/p1-taskqueue
@@ -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=3f7RoYEDBIpLHG1YY3eQ_RqZvkm4Er3FDEvFJeoAc8o,9572
7
- p1_taskqueue-0.1.17.dist-info/METADATA,sha256=FB4orsVrxnv00lTH4Mt1OESJCKQhFOZMv-_Ngy1Wvso,1597
8
- p1_taskqueue-0.1.17.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
9
- p1_taskqueue-0.1.17.dist-info/top_level.txt,sha256=hA3SM1ik2K8iPqtlt_-_nJ4TAePwHPN3vsOc4EiynqU,10
10
- p1_taskqueue-0.1.17.dist-info/RECORD,,
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,,
@@ -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=True)
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
- continue
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(