refactor(migration progress): moved to start looking at the go backedn

This commit is contained in:
2025-08-04 12:48:49 -05:00
parent a36552fd9b
commit a0179a41ba
15 changed files with 201 additions and 99 deletions

View File

@@ -29,6 +29,11 @@ import eom from "./services/eom/eomService.js";
import dataMart from "./services/dataMart/dataMartService.js";
import qualityRequest from "./services/quality/qualityService.js";
import produser from "./services/prodUser/prodUser.js";
import {
getSettings,
serverSettings,
} from "./services/server/controller/settings/getSettings.js";
import type { Settings } from "./types/settings.js";
// create the main prodlogin here
const username = "lst_user";
@@ -36,15 +41,16 @@ const password = "Alpla$$Prod";
export const lstAuth = btoa(`${username}:${password}`);
// checking to make sure we have the settings intialized
const { data: settingsData, error: settingError } = await tryCatch(
db.select().from(settings)
);
// const { data: settingsData, error: settingError } = await tryCatch(
// db.select().from(settings)
// );
if (settingError) {
throw Error("Error getting settings from the db. critical error.");
}
// if (settingError) {
// throw Error("Error getting settings from the db. critical error.");
// }
const serverIntialized: any = await getSettings();
const serverIntialized: any = settingsData;
export const installed =
serverIntialized.length === 0 && process.env.NODE_ENV !== "development"
? false
@@ -211,7 +217,8 @@ serve(
/**
* Only for ocme until we get them switched over to the single port setup.
*/
const setting = await db.select().from(settings);
// const setting = await db.select().from(settings);
const setting = serverSettings;
const isActive = setting.filter((n) => n.name === "ocmeService");
if (ocmeport && isActive[0]?.value === "1") {
serve(