fix: jobs schema payload, publisher confirms, worker reconnect, retry with backoff, replay endpoint

This commit is contained in:
2026-11-27 13:40:30 +03:00
parent 8760ec186a
commit 8c141c2866
6 changed files with 238 additions and 31 deletions
+16 -9
View File
@@ -24,12 +24,19 @@ def setup_rabbitmq(channel):
def publish_task(task: dict):
connection = pika.BlockingConnection(pika.URLParameters(RABBITMQ_URL))
channel = connection.channel()
setup_rabbitmq(channel)
channel.basic_publish(
exchange="",
routing_key=QUEUE_NAME,
body=json.dumps(task),
properties=pika.BasicProperties(delivery_mode=2),
)
connection.close()
try:
channel.confirm_delivery()
channel = connection.channel()
setup_rabbitmq(channel)
channel.basic_publish(
exchange="",
routing_key=QUEUE_NAME,
body=json.dumps(task),
properties=pika.BasicProperties(
delivery_mode=2,
content_type="application/json",
message_id=task.get("job_id"),
),
)
finally:
connection.close()