From a49a3e23f19f8964f5da10bbfc96354173de2e2a Mon Sep 17 00:00:00 2001 From: Jacopo Farina Date: Thu, 25 Jul 2024 10:54:42 +0200 Subject: [PATCH] Set docstrings, prepare for release --- CHANGELOG.md | 6 +++--- postgrestq/task_queue.py | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bfef8c8..7fd81af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,9 @@ # Changelog -## 1.2.0 - 2024-07-23 +## 1.2.0 - 2024-07-25 -* The `reschedule()` method have an optional parameter to decrease the ttl if set to True (False by default). -* The `add()` and `addMany()` methods set the can_start_at by default to the current time of the database clock for consistency. +* The `reschedule()` method has an optional parameter to decrease the TTL if set to True (False by default). +* The `add()` and `add_many()` methods set the `can_start_at` by default to the current time of the database clock, not Python, for consistency. ## 1.1.0 - 2024-07-01 diff --git a/postgrestq/task_queue.py b/postgrestq/task_queue.py index 8e54e97..abdb41c 100644 --- a/postgrestq/task_queue.py +++ b/postgrestq/task_queue.py @@ -588,9 +588,13 @@ def reschedule( Workers can use this method to "drop" a work unit in case of eviction (because of an external issue like terminating a machine - by aws and not because of a failure). + by AWS and not because of a failure). + Rescheduled work units are immediately available for processing again, + and unless decrease_ttl is set to True, the TTL is not modified. - This function can optionally modify the TTL. + This function can optionally modify the TTL, setting decrease_ttl to + True. This allows to handle a failure quickly without waiting the + lease_timeout. Parameters ----------