Skip to content

Commit

Permalink
Add await to warmServer in all environments (github#16841)
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonEtco authored Dec 9, 2020
1 parent 73f061c commit 64d3846
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,8 @@ if (!module.parent) {
if (status === false) {
// If in a deployed environment, warm the server at the start
if (process.env.NODE_ENV === 'production') {
// If in a true production environment, wait for the cache to be fully warmed.
if (process.env.HEROKU_PRODUCTION_APP) {
await warmServer()
} else {
// If not in a true production environment, don't wait for the cache to be fully warmed.
// This avoids deployment timeouts in environments with slower servers.
warmServer()
}
// If in a production environment, wait for the cache to be fully warmed.
await warmServer()
}

// workaround for https://github.com/expressjs/express/issues/1101
Expand Down

0 comments on commit 64d3846

Please sign in to comment.