mirror of
https://github.com/zedeus/nitter.git
synced 2024-12-13 03:26:30 +00:00
use separator in rss key for redis cache
This commit is contained in:
parent
35bb5f9132
commit
db090faf36
1 changed files with 7 additions and 5 deletions
|
@ -62,7 +62,7 @@ proc createRssRouter*(cfg: Config) =
|
||||||
|
|
||||||
let
|
let
|
||||||
cursor = getCursor()
|
cursor = getCursor()
|
||||||
key = $hash(genQueryUrl(query)) & cursor
|
key = "search:" & $hash(genQueryUrl(query)) & ":" & cursor
|
||||||
|
|
||||||
var rss = await getCachedRss(key)
|
var rss = await getCachedRss(key)
|
||||||
if rss.cursor.len > 0:
|
if rss.cursor.len > 0:
|
||||||
|
@ -82,7 +82,7 @@ proc createRssRouter*(cfg: Config) =
|
||||||
let
|
let
|
||||||
cursor = getCursor()
|
cursor = getCursor()
|
||||||
name = @"name"
|
name = @"name"
|
||||||
key = name & cursor
|
key = "twitter:" & name & ":" & cursor
|
||||||
|
|
||||||
var rss = await getCachedRss(key)
|
var rss = await getCachedRss(key)
|
||||||
if rss.cursor.len > 0:
|
if rss.cursor.len > 0:
|
||||||
|
@ -105,9 +105,9 @@ proc createRssRouter*(cfg: Config) =
|
||||||
of "search": initQuery(params(request), name=name)
|
of "search": initQuery(params(request), name=name)
|
||||||
else: Query(fromUser: @[name])
|
else: Query(fromUser: @[name])
|
||||||
|
|
||||||
var key = @"name" & "/" & @"tab"
|
var key = @"tab" & ":" & @"name" & ":"
|
||||||
if @"tab" == "search":
|
if @"tab" == "search":
|
||||||
key &= $hash(genQueryUrl(query))
|
key &= $hash(genQueryUrl(query)) & "/"
|
||||||
key &= getCursor()
|
key &= getCursor()
|
||||||
|
|
||||||
var rss = await getCachedRss(key)
|
var rss = await getCachedRss(key)
|
||||||
|
@ -123,7 +123,9 @@ proc createRssRouter*(cfg: Config) =
|
||||||
cond cfg.enableRss
|
cond cfg.enableRss
|
||||||
let
|
let
|
||||||
cursor = getCursor()
|
cursor = getCursor()
|
||||||
key = @"id" & cursor
|
key =
|
||||||
|
if cursor.len == 0: "lists:" & @"id"
|
||||||
|
else: "lists:" & @"id" & ":" & cursor
|
||||||
|
|
||||||
var rss = await getCachedRss(key)
|
var rss = await getCachedRss(key)
|
||||||
if rss.cursor.len > 0:
|
if rss.cursor.len > 0:
|
||||||
|
|
Loading…
Reference in a new issue