modify loadSettings logic to fetch env from DB
This commit is contained in:
1 parent
3e8f3a7a89
commit
b493b5e0e5
1 file changed
+8
-5
@@ -48,11 +48,14 @@ class SettingsService {
|
|||||||
|
|
||||||
// If there are any settings that weren't set by environment variables, use user settings from DB
|
// If there are any settings that weren't set by environment variables, use user settings from DB
|
||||||
for (const key in envConfig) {
|
for (const key in envConfig) {
|
||||||
if (
|
|
||||||
typeof envConfig?.[key] === "undefined" &&
|
const envValue = envConfig[key];
|
||||||
typeof dbSettings?.[key] !== "undefined"
|
const dbValue = dbSettings?.[key];
|
||||||
) {
|
|
||||||
this.settings[key] = dbSettings[key];
|
if (envValue === undefined || envValue === "") {
|
||||||
|
if (dbValue !== undefined) {
|
||||||
|
this.settings[key] = dbValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user