BunnyService: don't crash if config missing + HybridStorage reads from DB
This commit is contained in:
+7
-1
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user