Files
NapCatQQ/.pnpm-store/v3/files/db/018236ea30e369f3c9cb2167bfd7b1c047a122cc77fd16254143b1838d5cf3e940d4a724d7091b06f59c1c2e9e2e7549fca14b780ea50d5cd0b2fc1ffae7bd
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

22 lines
770 B
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.setCachePromise = exports.getCachePromise = void 0;
var cachePromise = new Map();
var getCachePromise = exports.getCachePromise = function getCachePromise(cacheKey) {
return cachePromise.get(cacheKey);
};
var setCachePromise = exports.setCachePromise = function setCachePromise(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);
});
};