From dfa2437f4670b470af07d0a9b718a33455a41e51 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Wed, 24 Jul 2024 15:12:23 +0100 Subject: [PATCH 1/2] console.log the crap out of startup --- packages/server/src/startup/index.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/packages/server/src/startup/index.ts b/packages/server/src/startup/index.ts index a5e26ca48e..a47a7c809b 100644 --- a/packages/server/src/startup/index.ts +++ b/packages/server/src/startup/index.ts @@ -27,6 +27,7 @@ import Koa from "koa" import { Server } from "http" import { AddressInfo } from "net" import fs from "fs" +import { c } from "tar" let STARTUP_RAN = false @@ -80,18 +81,31 @@ export async function startup( const address = server.address() as AddressInfo env._set("PORT", address.port) } + + console.log("Emitting port event") eventEmitter.emitPort(env.PORT) + + console.log("Initialising file system") fileSystem.init() + + console.log("Initialising redis") await redis.init() + + console.log("Initialising writethrough cache") cache.docWritethrough.init() + + console.log("Initialising events") eventInit() + if (app && server) { + console.log("Initialising websockets") initialiseWebsockets(app, server) } // run migrations on startup if not done via http // not recommended in a clustered environment if (!env.HTTP_MIGRATIONS && !env.isTest()) { + console.log("Running migrations") try { await migrations.migrate() } catch (e) { @@ -107,12 +121,15 @@ export async function startup( env.PLUGINS_DIR && fs.existsSync(env.PLUGINS_DIR) ) { + console.log("Monitoring plugin directory") watch() } // check for version updates + console.log("Checking for version updates") await installation.checkInstallVersion() + console.log("Initialising queues") // get the references to the queue promises, don't await as // they will never end, unless the processing stops let queuePromises = [] @@ -126,6 +143,7 @@ export async function startup( } queuePromises.push(initPro()) if (app) { + console.log("Initialising routes") // bring routes online as final step once everything ready await initRoutes(app) } @@ -141,6 +159,7 @@ export async function startup( bbAdminEmail && bbAdminPassword ) { + console.log("Initialising admin user") const tenantId = tenancy.getTenantId() await tenancy.doInTenant(tenantId, async () => { const exists = await users.doesUserExist(bbAdminEmail) @@ -171,5 +190,6 @@ export async function startup( }) } + console.log("Initialising JS runner") jsRunner.init() } From c0cff4b83482a791f3e2cd8dbc28858a550db63a Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Wed, 24 Jul 2024 15:17:03 +0100 Subject: [PATCH 2/2] Remove spurious import. --- packages/server/src/startup/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/server/src/startup/index.ts b/packages/server/src/startup/index.ts index a47a7c809b..5bb1f9aa0f 100644 --- a/packages/server/src/startup/index.ts +++ b/packages/server/src/startup/index.ts @@ -27,7 +27,6 @@ import Koa from "koa" import { Server } from "http" import { AddressInfo } from "net" import fs from "fs" -import { c } from "tar" let STARTUP_RAN = false