UNPKG

@grouparoo/core

Version:
19 lines (18 loc) 598 B
"use strict"; 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;