feat: Add pending migrations check during startup (#3744)

* feat: Add pending migrations check during startup

* fix: migration pending log message

Co-authored-by: Tom Moor <tom.moor@gmail.com>

Co-authored-by: Tom Moor <tom.moor@gmail.com>
This commit is contained in:
CuriousCorrelation
2022-07-09 00:00:16 +05:30
committed by GitHub
parent 4a46d19846
commit 746dc30aeb
2 changed files with 32 additions and 1 deletions

View File

@@ -20,7 +20,11 @@ import { requestErrorHandler } from "./logging/sentry";
import services from "./services";
import { getArg } from "./utils/args";
import { getSSLOptions } from "./utils/ssl";
import { checkEnv, checkMigrations } from "./utils/startup";
import {
checkEnv,
checkMigrations,
checkPendingMigrations,
} from "./utils/startup";
import { checkUpdates } from "./utils/updates";
// If a services flag is passed it takes priority over the environment variable
@@ -53,6 +57,7 @@ if (serviceNames.includes("collaboration")) {
// This function will only be called once in the original process
async function master() {
await checkEnv();
checkPendingMigrations();
await checkMigrations();
if (env.TELEMETRY && env.ENVIRONMENT === "production") {