mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-18 04:36:21 +02:00
feat: implement dynamic database connection reloading
This commit is contained in:
1 parent
80d125f933
commit
0e0d999027
2 files changed
+62
-23
No files matched your search
@@ -41,6 +41,11 @@ export async function saveDatabaseSettings(url: string) {
|
||||
|
||||
await fs.writeFile(CONFIG_FILE, JSON.stringify(config, null, 2));
|
||||
console.log("Database configuration saved to:", CONFIG_FILE);
|
||||
|
||||
// Refresh the shared DB instance immediately
|
||||
const { refreshDb } = await import("@/db");
|
||||
refreshDb();
|
||||
|
||||
return { success: true };
|
||||
} catch (error: unknown) {
|
||||
const errorMessage = error instanceof Error ? error.message : String(error);
|
||||
|
||||
Reference in new issue
Block a user