Optimizing caches

This commit is contained in:
Zef Hemel
2024-01-02 11:32:57 +01:00
parent faca08af8f
commit 8448a578fc
5 changed files with 36 additions and 39 deletions
+1 -2
View File
@@ -119,13 +119,12 @@ export async function readFile(
name: string,
): Promise<{ data: Uint8Array; meta: FileMeta } | undefined> {
const url = federatedPathToUrl(name);
console.log("Fetching fedderated file", url);
console.log("Fetching federated file", url);
const r = await nativeFetch(url);
if (r.status === 503) {
throw new Error("Offline");
}
const fileMeta = await responseToFileMeta(r, name);
console.log("Fetching", url);
if (r.status === 404) {
throw Error("Not found");
}