server: query cache is optional
The query cache can be disabled in the configuration file and should thus be considered optional. It should not be assumed that it is present.
This commit is contained in:
parent
c0364f236c
commit
67089193ea
10 changed files with 12 additions and 12 deletions
|
@ -73,7 +73,7 @@ export async function importCustomEmojis(job: Bull.Job<DbUserImportJobData>, don
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
await db.queryResultCache!.remove(['meta_emojis']);
|
await db.queryResultCache?.remove(['meta_emojis']);
|
||||||
|
|
||||||
cleanup();
|
cleanup();
|
||||||
|
|
||||||
|
|
|
@ -36,5 +36,5 @@ export default define(meta, paramDef, async (ps) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
await db.queryResultCache!.remove(['meta_emojis']);
|
await db.queryResultCache?.remove(['meta_emojis']);
|
||||||
});
|
});
|
||||||
|
|
|
@ -43,7 +43,7 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||||
type: file.webpublicType ?? file.type,
|
type: file.webpublicType ?? file.type,
|
||||||
}).then(x => Emojis.findOneByOrFail(x.identifiers[0]));
|
}).then(x => Emojis.findOneByOrFail(x.identifiers[0]));
|
||||||
|
|
||||||
await db.queryResultCache!.remove(['meta_emojis']);
|
await db.queryResultCache?.remove(['meta_emojis']);
|
||||||
|
|
||||||
publishBroadcastStream('emojiAdded', {
|
publishBroadcastStream('emojiAdded', {
|
||||||
emoji: await Emojis.pack(emoji.id),
|
emoji: await Emojis.pack(emoji.id),
|
||||||
|
|
|
@ -62,7 +62,7 @@ export default define(meta, paramDef, async (ps) => {
|
||||||
type: driveFile.webpublicType ?? driveFile.type,
|
type: driveFile.webpublicType ?? driveFile.type,
|
||||||
}).then(x => Emojis.findOneByOrFail(x.identifiers[0]));
|
}).then(x => Emojis.findOneByOrFail(x.identifiers[0]));
|
||||||
|
|
||||||
await db.queryResultCache!.remove(['meta_emojis']);
|
await db.queryResultCache?.remove(['meta_emojis']);
|
||||||
|
|
||||||
publishBroadcastStream('emojiAdded', {
|
publishBroadcastStream('emojiAdded', {
|
||||||
emoji: await Emojis.pack(copied.id),
|
emoji: await Emojis.pack(copied.id),
|
||||||
|
|
|
@ -29,9 +29,9 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||||
|
|
||||||
for (const emoji of emojis) {
|
for (const emoji of emojis) {
|
||||||
await Emojis.delete(emoji.id);
|
await Emojis.delete(emoji.id);
|
||||||
|
|
||||||
await db.queryResultCache!.remove(['meta_emojis']);
|
await db.queryResultCache?.remove(['meta_emojis']);
|
||||||
|
|
||||||
insertModerationLog(me, 'deleteEmoji', { emoji });
|
insertModerationLog(me, 'deleteEmoji', { emoji });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -29,7 +29,7 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||||
|
|
||||||
await Emojis.delete(emoji.id);
|
await Emojis.delete(emoji.id);
|
||||||
|
|
||||||
await db.queryResultCache!.remove(['meta_emojis']);
|
await db.queryResultCache?.remove(['meta_emojis']);
|
||||||
|
|
||||||
insertModerationLog(me, 'deleteEmoji', { emoji });
|
insertModerationLog(me, 'deleteEmoji', { emoji });
|
||||||
});
|
});
|
||||||
|
|
|
@ -36,5 +36,5 @@ export default define(meta, paramDef, async (ps) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
await db.queryResultCache!.remove(['meta_emojis']);
|
await db.queryResultCache?.remove(['meta_emojis']);
|
||||||
});
|
});
|
||||||
|
|
|
@ -32,5 +32,5 @@ export default define(meta, paramDef, async (ps) => {
|
||||||
aliases: ps.aliases,
|
aliases: ps.aliases,
|
||||||
});
|
});
|
||||||
|
|
||||||
await db.queryResultCache!.remove(['meta_emojis']);
|
await db.queryResultCache?.remove(['meta_emojis']);
|
||||||
});
|
});
|
||||||
|
|
|
@ -34,5 +34,5 @@ export default define(meta, paramDef, async (ps) => {
|
||||||
category: ps.category,
|
category: ps.category,
|
||||||
});
|
});
|
||||||
|
|
||||||
await db.queryResultCache!.remove(['meta_emojis']);
|
await db.queryResultCache?.remove(['meta_emojis']);
|
||||||
});
|
});
|
||||||
|
|
|
@ -42,5 +42,5 @@ export default define(meta, paramDef, async (ps) => {
|
||||||
aliases: ps.aliases,
|
aliases: ps.aliases,
|
||||||
});
|
});
|
||||||
|
|
||||||
await db.queryResultCache!.remove(['meta_emojis']);
|
await db.queryResultCache?.remove(['meta_emojis']);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue