mirror of
https://github.com/certd/certd.git
synced 2026-05-15 20:47:31 +08:00
perf: 优化证书流水线创建,支持选择分组
This commit is contained in:
@@ -7,6 +7,7 @@ import { routerUtils } from "./util.router";
|
||||
import { treeUtils } from "./util.tree";
|
||||
import { hashUtils } from "./util.hash";
|
||||
import { amountUtils } from "./util.amount";
|
||||
import { cache } from "./util.cache";
|
||||
export const util = {
|
||||
...envs,
|
||||
...sites,
|
||||
@@ -17,5 +18,6 @@ export const util = {
|
||||
tree: treeUtils,
|
||||
hash: hashUtils,
|
||||
amount: amountUtils,
|
||||
cache,
|
||||
};
|
||||
export const utils = util;
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
export class Cache {
|
||||
bucket: Record<string, any> = {};
|
||||
|
||||
async get(key: string) {
|
||||
return this.bucket[key];
|
||||
}
|
||||
|
||||
async set(key: string, value: any, ttl: number) {
|
||||
this.bucket[key] = value;
|
||||
}
|
||||
|
||||
async del(key: string) {
|
||||
delete this.bucket[key];
|
||||
}
|
||||
}
|
||||
|
||||
export const cache = new Cache();
|
||||
Reference in New Issue
Block a user