fix parameter for cache fetcher

This commit is contained in:
Johann150 2022-11-13 20:31:24 +01:00
parent d1ec058d5c
commit 9d9b2da6cc
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1
2 changed files with 2 additions and 2 deletions

View file

@ -43,7 +43,7 @@ export class Cache<T> {
if (cached !== undefined) {
return cached;
} else {
const value = await this.fetcher();
const value = await this.fetcher(key);
// don't cache undefined
if (value !== undefined)

View file

@ -15,7 +15,7 @@ import { decodeReaction } from './reaction-lib.js';
const cache = new Cache<Emoji | null>(
12 * HOUR,
async (key) => {
const [host, name] = key.split(':');
const [host, name] = key.split(':');
return (await Emojis.findOneBy({
name,
host: host || IsNull(),