Skip to content
Snippets Groups Projects
Commit 82969b40 authored by Simon Malesys's avatar Simon Malesys
Browse files

Mark server as ready sooner

parent 42c726de
No related branches found
No related tags found
No related merge requests found
Pipeline #153276 passed with stages
in 8 minutes and 33 seconds
...@@ -169,6 +169,9 @@ fastify.listen({ ...@@ -169,6 +169,9 @@ fastify.listen({
host: envConfig.ABSD_SERVER_HOST, host: envConfig.ABSD_SERVER_HOST,
port: envConfig.ABSD_SERVER_PORT port: envConfig.ABSD_SERVER_PORT
}).then(async () => { }).then(async () => {
fastify.serverIsReady = true
fastify.log.info({ envConfig })
if (envConfig.NODE_ENV === 'production') { if (envConfig.NODE_ENV === 'production') {
fastify.databaseIsReady = false fastify.databaseIsReady = false
return await buildDatabase() return await buildDatabase()
...@@ -177,8 +180,7 @@ fastify.listen({ ...@@ -177,8 +180,7 @@ fastify.listen({
if (dbResults) { if (dbResults) {
fastify.log.info(`${envConfig.ABSD_DB_NAME} database created`) fastify.log.info(`${envConfig.ABSD_DB_NAME} database created`)
} }
fastify.log.info({ envConfig })
fastify.serverIsReady = true
fastify.databaseIsReady = true fastify.databaseIsReady = true
}).catch(err => { }).catch(err => {
fastify.log.error(err) fastify.log.error(err)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment