packages/django-dramatiq-postgres: broker: fix task expiration (#17178)

This commit is contained in:
Marc 'risson' Schmitt
2025-10-02 14:45:56 +02:00
committed by GitHub
parent 40811eabc9
commit 8f644c3d3a
@@ -465,7 +465,7 @@ class _PostgresConsumer(Consumer):
self.logger.debug("Running garbage collector")
count = self.query_set.filter(
state__in=(TaskState.DONE, TaskState.REJECTED),
mtime__lte=timezone.now() - timedelta(seconds=Conf().task_purge_interval),
mtime__lte=timezone.now() - timedelta(seconds=Conf().task_expiration),
result_expiry__lte=timezone.now(),
).delete()
self.logger.info("Purged messages in all queues", count=count)