fix getting link from cache
This commit is contained in:
parent
0fc37b36ab
commit
e0ae010f37
@ -172,7 +172,7 @@ async function getAdmin(match, params) {
|
||||
}
|
||||
|
||||
async function find(match) {
|
||||
if (match.address && match.domain_id && env.REDIS_ENABLED) {
|
||||
if (match.address && match.domain_id !== undefined && env.REDIS_ENABLED) {
|
||||
const key = redis.key.link(match.address, match.domain_id);
|
||||
const cachedLink = await redis.client.get(key);
|
||||
if (cachedLink) return JSON.parse(cachedLink);
|
||||
|
@ -14,7 +14,7 @@ if (env.REDIS_ENABLED) {
|
||||
}
|
||||
|
||||
const key = {
|
||||
link: (address, domain_id, user_id) => `l:${address}:${domain_id || ""}:${user_id || ""}`,
|
||||
link: (address, domain_id) => `l:${address}:${domain_id || ""}`,
|
||||
domain: (address) => `d:${address}`,
|
||||
stats: (link_id) => `s:${link_id}`,
|
||||
host: (address) => `h:${address}`,
|
||||
|
Loading…
x
Reference in New Issue
Block a user