Don't cache empty profile
This commit is contained in:
parent
22b0bce1ea
commit
f0db3a8bc2
|
@ -48,6 +48,7 @@ proc cache*(data: PhotoRail; id: string) {.async.} =
|
||||||
await setex("pr:" & id, baseCacheTime, data.pack)
|
await setex("pr:" & id, baseCacheTime, data.pack)
|
||||||
|
|
||||||
proc cache*(data: Profile) {.async.} =
|
proc cache*(data: Profile) {.async.} =
|
||||||
|
if data.username.len == 0: return
|
||||||
pool.withAcquire(r):
|
pool.withAcquire(r):
|
||||||
r.startPipelining()
|
r.startPipelining()
|
||||||
discard await r.setex(data.toKey, baseCacheTime, pack(data))
|
discard await r.setex(data.toKey, baseCacheTime, pack(data))
|
||||||
|
|
Loading…
Reference in New Issue