@grouparoo/core
Version:
The Grouparoo Core
19 lines (18 loc) • 598 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ModelCache = void 0;
const actionhero_1 = require("actionhero");
class ModelCache {
constructor(findAllWithCache, findOneWithCache, include) {
this.TTL = actionhero_1.env === "test" ? -1 : 1000 * 30;
this.expires = 0;
this.findAllWithCache = findAllWithCache.bind(this);
this.findOneWithCache = findOneWithCache.bind(this);
this.include = include;
this.instances = [];
}
invalidate() {
this.expires = 0;
}
}
exports.ModelCache = ModelCache;