|
|
@ -2,6 +2,8 @@ import * as TypeORM from "typeorm"; |
|
|
|
import * as LRUCache from "lru-cache"; |
|
|
|
import * as LRUCache from "lru-cache"; |
|
|
|
import * as DeepCopy from "deepcopy"; |
|
|
|
import * as DeepCopy from "deepcopy"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
declare var syzoj: any; |
|
|
|
|
|
|
|
|
|
|
|
interface Paginater { |
|
|
|
interface Paginater { |
|
|
|
pageCnt: number; |
|
|
|
pageCnt: number; |
|
|
|
perPage: number; |
|
|
|
perPage: number; |
|
|
@ -23,7 +25,7 @@ const caches: Map<string, LRUCache<number, Model>> = new Map(); |
|
|
|
function ensureCache(modelName) { |
|
|
|
function ensureCache(modelName) { |
|
|
|
if (!caches.has(modelName)) { |
|
|
|
if (!caches.has(modelName)) { |
|
|
|
caches.set(modelName, new LRUCache({ |
|
|
|
caches.set(modelName, new LRUCache({ |
|
|
|
max: 500 |
|
|
|
max: syzoj.config.db.cache_size |
|
|
|
})); |
|
|
|
})); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|