Use faster API to get pinned tweets

This commit is contained in:
Zed
2022-01-23 07:45:01 +01:00
parent 51ae076ea0
commit 27183f1a74
5 changed files with 13 additions and 3 deletions

View File

@@ -151,9 +151,8 @@ proc getCachedTweet*(id: int64): Future[Tweet] {.async.} =
if tweet != redisNil:
tweet.deserialize(Tweet)
else:
let conv = await getTweet($id)
if not conv.isNil:
result = conv.tweet
result = await getStatus($id)
if result.isNil:
await cache(result)
proc getCachedPhotoRail*(name: string): Future[PhotoRail] {.async.} =