From 27aa7c4034bad125959092b16a8dd12fdc3ad82c Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Sun, 22 Aug 2021 16:48:06 +0200 Subject: [PATCH] fix: [api] fix ttl missing bug --- bin/server.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/server.py b/bin/server.py index 0370fda..afa177e 100644 --- a/bin/server.py +++ b/bin/server.py @@ -104,6 +104,9 @@ class lookup(Resource): if not is_hex(sha1): return {'message': 'SHA-1 is not in hex format'}, 400 k = sha1.upper() + ttl = False + if session: + ttl = get_session() if not rdb.exists("h:{}".format(k)): if stats: rdb.zincrby("s:nx:sha1", score, k)