perf(server): cache blocking

This commit is contained in:
syuilo
2023-02-04 12:40:40 +09:00
parent b7522f69e7
commit 0c12e80106
8 changed files with 99 additions and 65 deletions

View File

@@ -1,5 +1,7 @@
import { bindThis } from '@/decorators.js';
// TODO: メモリ節約のためあまり参照されないキーを定期的に削除できるようにする?
export class Cache<T> {
public cache: Map<string | null, { date: number; value: T; }>;
private lifetime: number;