2024-12-22 12:33:49 -05:00
|
|
|
import { ensureActions } from "./ensureActions";
|
|
|
|
import { copyInConfig } from "./copyInConfig";
|
2024-12-25 15:58:46 -05:00
|
|
|
import { setupServerAdmin } from "./setupServerAdmin";
|
2025-01-01 17:50:12 -05:00
|
|
|
import logger from "@server/logger";
|
2025-02-24 22:46:55 -05:00
|
|
|
import { clearStaleData } from "./clearStaleData";
|
2024-12-22 12:33:49 -05:00
|
|
|
|
|
|
|
export async function runSetupFunctions() {
|
2024-12-25 15:54:32 -05:00
|
|
|
try {
|
|
|
|
await copyInConfig(); // copy in the config to the db as needed
|
|
|
|
await setupServerAdmin();
|
|
|
|
await ensureActions(); // make sure all of the actions are in the db and the roles
|
2025-02-24 22:46:55 -05:00
|
|
|
await clearStaleData();
|
2024-12-25 15:54:32 -05:00
|
|
|
} catch (error) {
|
2025-01-01 17:50:12 -05:00
|
|
|
logger.error("Error running setup functions:", error);
|
2024-12-25 15:54:32 -05:00
|
|
|
process.exit(1);
|
|
|
|
}
|
|
|
|
}
|