Rename files
This commit is contained in:
22
packages/system/src/cache/relay-metric.ts
vendored
Normal file
22
packages/system/src/cache/relay-metric.ts
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
import { db, RelayMetrics } from ".";
|
||||
import { FeedCache } from "@snort/shared";
|
||||
|
||||
export class RelayMetricCache extends FeedCache<RelayMetrics> {
|
||||
constructor() {
|
||||
super("RelayMetrics", db.relayMetrics);
|
||||
}
|
||||
|
||||
key(of: RelayMetrics): string {
|
||||
return of.addr;
|
||||
}
|
||||
|
||||
override async preload(): Promise<void> {
|
||||
await super.preload();
|
||||
// load everything
|
||||
await this.buffer([...this.onTable]);
|
||||
}
|
||||
|
||||
takeSnapshot(): Array<RelayMetrics> {
|
||||
return [...this.cache.values()];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user