MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / init

Method init

komari/komari.ts:31–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29
30 // 初始化数据库
31 private static init(): void {
32 if (this.initialized) return;
33
34 try {
35 this.db = new Database(CONFIG_DB_PATH);
36 this.db.exec(`
37 CREATE TABLE IF NOT EXISTS config (
38 key TEXT PRIMARY KEY,
39 value TEXT NOT NULL,
40 updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
41 )
42 `);
43 this.initialized = true;
44 } catch (error) {
45 console.error("初始化Komari配置数据库失败:", error);
46 }
47 }
48
49 static get(key: string, defaultValue?: string): string {
50 this.init();

Callers 4

getMethod · 0.95
setMethod · 0.95
getAllMethod · 0.95
deleteMethod · 0.95

Calls 2

execMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected