Skip to content

Commit

Permalink
Merge pull request #1585 from OneUptime/oneuptime-copilot-oneuptime-c…
Browse files Browse the repository at this point in the history
…opilot-improve-comments-xTNiR

[OneUptime Copilot] Improve Comments on /App/Index.ts
  • Loading branch information
simlarsen authored Jul 24, 2024
2 parents ea16232 + 7e05939 commit 3a72c5d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions App/Index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ process.env["SERVICE_NAME"] = "app";
const init: PromiseVoidFunction = async (): Promise<void> => {
try {
const statusCheck: PromiseVoidFunction = async (): Promise<void> => {
// Check the status of infrastructure components
return await InfrastructureStatus.checkStatus({
checkClickhouseStatus: true,
checkPostgresStatus: true,
checkRedisStatus: true,
});
};

// init the app
// Initialize the app with service name and status checks
await App.init({
appName: process.env["SERVICE_NAME"] || "app",
statusOptions: {
Expand All @@ -39,21 +40,23 @@ const init: PromiseVoidFunction = async (): Promise<void> => {
},
});

// connect to the database.
// Connect to Postgres database
await PostgresAppInstance.connect(
PostgresAppInstance.getDatasourceOptions(),
);

// connect redis
// Connect to Redis
await Redis.connect();

// Connect to Clickhouse database
await ClickhouseAppInstance.connect(
ClickhouseAppInstance.getDatasourceOptions(),
);

// Initialize real-time functionalities
await Realtime.init();

// init featuresets
// Initialize feature sets
await IdentityRoutes.init();
await NotificationRoutes.init();
await DocsRoutes.init();
Expand All @@ -62,10 +65,10 @@ const init: PromiseVoidFunction = async (): Promise<void> => {
await Workers.init();
await Workflow.init();

// home should be in the end because it has the catch all route.
// Initialize home routes at the end since it has a catch-all route
await HomeRoutes.init();

// add default routes
// Add default routes to the app
await App.addDefaultRoutes();
} catch (err) {
logger.error("App Init Failed:");
Expand Down

0 comments on commit 3a72c5d

Please sign in to comment.