Merge branch 'master' into workflow-refactor

This commit is contained in:
Simon Larsen 2024-09-16 15:27:10 -07:00
commit a35d26bc6a
No known key found for this signature in database
GPG Key ID: 96C5DCA24769DBCA

View File

@ -4,6 +4,10 @@ import InfrastructureStatus from "Common/Server/Infrastructure/Status";
import logger from "Common/Server/Utils/Logger";
import App from "Common/Server/Utils/StartServer";
import Telemetry from "Common/Server/Utils/Telemetry";
import Realtime from "Common/Server/Utils/Realtime";
import PostgresAppInstance from "Common/Server/Infrastructure/PostgresDatabase";
import Redis from "Common/Server/Infrastructure/Redis";
import { ClickhouseAppInstance } from "Common/Server/Infrastructure/ClickhouseDatabase";
import "ejs";
const APP_NAME: string = "worker";
@ -33,6 +37,20 @@ const init: PromiseVoidFunction = async (): Promise<void> => {
},
});
// Connect to Postgres database
await PostgresAppInstance.connect();
// Connect to Redis
await Redis.connect();
// Connect to Clickhouse database
await ClickhouseAppInstance.connect(
ClickhouseAppInstance.getDatasourceOptions(),
);
// Initialize real-time functionalities
await Realtime.init();
// Initialize home routes at the end since it has a catch-all route
await WorkerRoutes.init();