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

Method saveWhoisRecord

whois/whois.ts:373–389  ·  view source on GitHub ↗
(record: WhoisRecord)

Source from the content-addressed store, hash-verified

371 return null;
372 }
373
374 return cache;
375 }
376
377 private async saveWhoisRecord(record: WhoisRecord) {
378 if (!this.db) return;
379
380 // 保存到缓存
381 this.db.data.cache[record.domain.toLowerCase()] = record;
382
383 // 保存到历史
384 this.db.data.history.unshift(record);
385
386 // 限制历史记录数量
387 const maxHistory = this.db.data.settings.maxHistory || 100;
388 if (this.db.data.history.length > maxHistory) {
389 this.db.data.history = this.db.data.history.slice(0, maxHistory);
390 }
391
392 await this.db.write();

Callers 2

handleWhoisMethod · 0.95
handleBatchQueryMethod · 0.95

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected