mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2026-02-03 16:20:38 +03:00
Update src/utils/createMemoryCache.js
Co-authored-by: Ajay Ramachandran <dev@ajay.app>
This commit is contained in:
@@ -3,7 +3,7 @@ module.exports = function createMemoryCache(memoryFn, cacheTimeMs) {
|
|||||||
const cache = new Map();
|
const cache = new Map();
|
||||||
// holds the promises that are not fulfilled
|
// holds the promises that are not fulfilled
|
||||||
const promiseMemory = new Map();
|
const promiseMemory = new Map();
|
||||||
return function (...args) {
|
return (...args) => {
|
||||||
// create cacheKey by joining arguments as string
|
// create cacheKey by joining arguments as string
|
||||||
const cacheKey = args.join('.');
|
const cacheKey = args.join('.');
|
||||||
// check if promising is already running
|
// check if promising is already running
|
||||||
|
|||||||
Reference in New Issue
Block a user