Cache profiles

This commit is contained in:
Zed
2019-06-20 20:04:18 +02:00
parent 63d7528b8f
commit 6103db6893
8 changed files with 78 additions and 100 deletions

View File

@ -1,13 +1,13 @@
import asyncdispatch, httpclient, times, strutils, hashes, random, uri
import jester, regex
import api, utils, types
import api, utils, types, cache
import views/[user, general, conversation]
proc showTimeline(name: string; num=""): Future[string] {.async.} =
let
username = name.strip(chars={'/'})
profileFut = getProfile(username)
profileFut = getCachedProfile(username)
tweetsFut = getTimeline(username, after=num)
let profile = await profileFut