Files
NapCatQQ/.pnpm-store/v3/files/03/2610ae6c64e9727635d9d6a118baa1059d2045707ed5280b3554c6f2f7b2e9b8fdf55b2610083f580077613da38b62f4fc555c93c874ddd29d76d9458595c6
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

20 lines
631 B
Plaintext

var cachePromise = new Map();
var getCachePromise = function (cacheKey) {
return cachePromise.get(cacheKey);
};
var setCachePromise = function (cacheKey, promise) {
// Should cache the same promise, cannot be promise.finally
// Because the promise.finally will change the reference of the promise
cachePromise.set(cacheKey, promise);
// no use promise.finally for compatibility
promise
.then(function (res) {
cachePromise.delete(cacheKey);
return res;
})
.catch(function () {
cachePromise.delete(cacheKey);
});
};
export { getCachePromise, setCachePromise };