mirror of
https://github.com/zedeus/nitter
synced 2026-09-05 22:59:31 +00:00
Improve memory usage by making Thread a ref object
This commit is contained in:
parent
640bb2fadf
commit
92e3df411f
4 changed files with 7 additions and 4 deletions
|
|
@ -110,6 +110,7 @@ proc getVideo*(tweet: Tweet; token: string) {.async.} =
|
|||
tokenUses.inc
|
||||
|
||||
proc getVideos*(thread: Thread; token="") {.async.} =
|
||||
if thread == nil: return
|
||||
|
||||
var gToken = token
|
||||
if gToken.len == 0:
|
||||
|
|
@ -150,6 +151,7 @@ proc getPoll*(tweet: Tweet) {.async.} =
|
|||
tweet.poll = some(parsePoll(html))
|
||||
|
||||
proc getPolls*(thread: Thread) {.async.} =
|
||||
if thread == nil: return
|
||||
var polls = thread.tweets.filterIt(it.poll.isSome)
|
||||
await all(polls.map(getPoll))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue