Add a time-based cache for the progress result from the API

This commit is contained in:
2024-12-17 10:46:10 +01:00
parent 1c74ae9de5
commit 3822339dd9
7 changed files with 112 additions and 34 deletions
+7 -2
View File
@@ -1,4 +1,4 @@
interface Progress {
interface ProgressType {
percentageOfIpv4Scanned: number; // assuming this is a number
totalFiltered: bigint;
amountOfIpv4Left: bigint;
@@ -6,4 +6,9 @@ interface Progress {
discardedDbSize: bigint;
filteredDbSize: bigint;
myDbSize: bigint;
}
}
type CacheEntry<T> = {
data: T;
timestamp: number;
};