mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 11:17:05 +02:00
start of performance
This commit is contained in:
1 parent
08c909fbe2
commit
b3e439669b
11 files changed
+64
-87
No files matched your search
@@ -0,0 +1 @@
|
||||
export const IDS_API_BASE = "https://ids.blitzkit.app";
|
||||
@@ -0,0 +1,22 @@
|
||||
import { GitObjectStorage } from "../core/blitzkit/gitObjectStorage";
|
||||
import { sleep, withinTimeLimit } from "../discoverIds/time";
|
||||
import { IdsManifest } from "../discoverIds/types";
|
||||
import { IDS_API_BASE } from "./constants";
|
||||
import { PerformanceManifest } from "./types";
|
||||
|
||||
const storage = await new GitObjectStorage(
|
||||
"blitzkit/data-performance",
|
||||
"../../temp/performance",
|
||||
import.meta.env.GH_TOKEN,
|
||||
).init();
|
||||
|
||||
const manifest = await storage.json<PerformanceManifest>("manifest.json");
|
||||
const idsManifest = await fetch(`${IDS_API_BASE}/manifest.json`).then(
|
||||
(response) => response.json() as Promise<IdsManifest>,
|
||||
);
|
||||
|
||||
while (withinTimeLimit()) {
|
||||
await sleep();
|
||||
}
|
||||
|
||||
// storage.commit();
|
||||
@@ -0,0 +1,6 @@
|
||||
export type PerformanceManifest = PerformanceManifestV1;
|
||||
|
||||
interface PerformanceManifestV1 {
|
||||
version: 1;
|
||||
last_updated: number;
|
||||
}
|
||||
Reference in new issue
Block a user