Skip to content
Snippets Groups Projects
Commit 2a484142 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

SW-957: by default, expire message after 5 days

parent 488c9ab5
No related branches found
No related tags found
No related merge requests found
......@@ -74,10 +74,10 @@ class LofarMessage:
'Subject': self.subject}
}
if self.ttl:
if self.ttl is not None:
# https://www.rabbitmq.com/ttl.html#per-message-ttl-in-publishers
# Since the expiration field must be a string, the broker will (only) accept the string representation of the number.
publish_kwargs['expiration'] = str(self.ttl)
# https://docs.celeryq.dev/projects/kombu/en/stable/reference/kombu.html?highlight=publish#kombu.Producer.publish
publish_kwargs['expiration'] = float(self.ttl)
return publish_kwargs
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment