BunnyService: don't crash if config missing + HybridStorage reads from DB

This commit is contained in:
2026-06-09 00:09:06 +02:00
parent 55df1e27f0
commit b1d3b77edb
2 changed files with 11 additions and 5 deletions
+7 -1
View File
@@ -51,6 +51,7 @@ interface BunnyLibraryResponse {
}
export class BunnyService {
disabled: boolean = false;
private migratedGuids: Set<string> = new Set();
private migratedGuidsRefreshedAt: number = 0;
@@ -100,7 +101,12 @@ export class BunnyService {
this.hostname = process.env.BUNNY_HOSTNAME!;
if (!this.apiKey || !this.libraryId || !this.hostname) {
throw new Error("Missing Bunny.net configuration");
console.warn("⚠️ Missing Bunny.net configuration — BunnyService running in disabled mode (uses DB-only)");
this.disabled = true;
this.apiKey = "";
this.libraryId = "";
this.cdnHostname = "";
return;
}
}