forked from FoundKeyGang/FoundKey
fix parameter for cache fetcher
This commit is contained in:
parent
d1ec058d5c
commit
9d9b2da6cc
2 changed files with 2 additions and 2 deletions
|
@ -43,7 +43,7 @@ export class Cache<T> {
|
||||||
if (cached !== undefined) {
|
if (cached !== undefined) {
|
||||||
return cached;
|
return cached;
|
||||||
} else {
|
} else {
|
||||||
const value = await this.fetcher();
|
const value = await this.fetcher(key);
|
||||||
|
|
||||||
// don't cache undefined
|
// don't cache undefined
|
||||||
if (value !== undefined)
|
if (value !== undefined)
|
||||||
|
|
|
@ -15,7 +15,7 @@ import { decodeReaction } from './reaction-lib.js';
|
||||||
const cache = new Cache<Emoji | null>(
|
const cache = new Cache<Emoji | null>(
|
||||||
12 * HOUR,
|
12 * HOUR,
|
||||||
async (key) => {
|
async (key) => {
|
||||||
const [host, name] = key.split(':');
|
const [host, name] = key.split(':');
|
||||||
return (await Emojis.findOneBy({
|
return (await Emojis.findOneBy({
|
||||||
name,
|
name,
|
||||||
host: host || IsNull(),
|
host: host || IsNull(),
|
||||||
|
|
Loading…
Reference in a new issue