summaryrefslogtreecommitdiff
path: root/rq
diff options
context:
space:
mode:
authorSimó Albert i Beltran <sim6@bona.gent>2023-02-15 11:17:09 +0100
committerGitHub <noreply@github.com>2023-02-15 17:17:09 +0700
commit5798cddd0463cb2e639469689aaad26cc2bbc28f (patch)
tree1772021db3e97d3bed51666d5118fca4debe380b /rq
parent46b5cf64c348423b253ec86a99c9bcd972478345 (diff)
downloadrq-5798cddd0463cb2e639469689aaad26cc2bbc28f.tar.gz
fix: queue.result_ttl=-1 (#1819)
* test: queue.result_ttl=-1 Signed-off-by: Simó Albert i Beltran <sim6@bona.gent> * test: queue.result_ttl=0 Signed-off-by: Simó Albert i Beltran <sim6@bona.gent> * fix: queue.result_ttl=-1 Signed-off-by: Simó Albert i Beltran <sim6@bona.gent> --------- Signed-off-by: Simó Albert i Beltran <sim6@bona.gent>
Diffstat (limited to 'rq')
-rw-r--r--rq/results.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/rq/results.py b/rq/results.py
index a6dafde..8ff770d 100644
--- a/rq/results.py
+++ b/rq/results.py
@@ -169,7 +169,10 @@ class Result(object):
if pipeline is None:
self.id = result.decode()
if ttl is not None:
- connection.expire(key, ttl)
+ if ttl == -1:
+ connection.persist(key)
+ else:
+ connection.expire(key, ttl)
return self.id
def serialize(self):