From f0db3a8bc2f87d14b63274678aef1829414953cc Mon Sep 17 00:00:00 2001 From: Zed Date: Wed, 3 Jun 2020 07:49:32 +0200 Subject: [PATCH] Don't cache empty profile --- src/redis_cache.nim | 1 + 1 file changed, 1 insertion(+) diff --git a/src/redis_cache.nim b/src/redis_cache.nim index bdd02a7..a508b84 100644 --- a/src/redis_cache.nim +++ b/src/redis_cache.nim @@ -48,6 +48,7 @@ proc cache*(data: PhotoRail; id: string) {.async.} = await setex("pr:" & id, baseCacheTime, data.pack) proc cache*(data: Profile) {.async.} = + if data.username.len == 0: return pool.withAcquire(r): r.startPipelining() discard await r.setex(data.toKey, baseCacheTime, pack(data))