mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-04-19 21:03:56 +02:00
parent
a8676e6ebd
commit
c23f04ba5a
1 changed files with 4 additions and 0 deletions
|
@ -25,6 +25,10 @@ export default class CacheProvider {
|
||||||
expiresIn,
|
expiresIn,
|
||||||
} = options[options.length - 1] as Options;
|
} = options[options.length - 1] as Options;
|
||||||
|
|
||||||
|
if (key.length < 4) {
|
||||||
|
throw new Error(`Cache key ${key} is too short.`);
|
||||||
|
}
|
||||||
|
|
||||||
const cachedResult = await Cache.findByPk(key);
|
const cachedResult = await Cache.findByPk(key);
|
||||||
|
|
||||||
if (cachedResult) {
|
if (cachedResult) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue