fix: revert no server start (#6790)

**Why**
- we want to start a server so we can allow health checks on workers
This commit is contained in:
Sebastian Rindom authored and GitHub committed 2024-03-22 14:57:34 +00:00
1 parent 7e93eda1a4
commit 4c3389e1e6
1 file changed
+1 -8
+1 -8
View File
@@ -24,11 +24,7 @@ export default async function ({ port, directory }) {
expressApp: app,
})
const shouldStartServer =
configModule.projectConfig.worker_mode !== "worker"
let server
if (shouldStartServer) {
const serverActivity = Logger.activity(`Creating server`)
server = GracefulShutdownServer.create(
app.listen(port, (err) => {
@@ -56,15 +52,12 @@ export default async function ({ port, directory }) {
process.on("SIGTERM", gracefulShutDown)
process.on("SIGINT", gracefulShutDown)
} else {
Logger.info("Running in worker mode, server will not be started.")
}
scheduleJob(CRON_SCHEDULE, () => {
track("PING")
})
return shouldStartServer ? { dbConnection, server } : { dbConnection }
return { dbConnection, server }
} catch (err) {
Logger.error("Error starting server", err)
process.exit(1)