Skip to content

Commit 25a6fae

Browse files
authored
Branch was updated using the 'autoupdate branch' Actions workflow.
2 parents 29fe141 + 1e7af2a commit 25a6fae

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

server.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,14 @@ if (!module.parent) {
1818
if (status === false) {
1919
// If in a deployed environment, warm the server at the start
2020
if (process.env.NODE_ENV === 'production') {
21-
// If in a production environment, wait for the cache to be fully warmed.
22-
await warmServer()
21+
// If in a true production environment, wait for the cache to be fully warmed.
22+
if (process.env.HEROKU_PRODUCTION_APP || process.env.GITHUB_ACTIONS) {
23+
await warmServer()
24+
} else {
25+
// If not in a true production environment, don't wait for the cache to be fully warmed.
26+
// This avoids deployment timeouts in environments with slower servers.
27+
warmServer()
28+
}
2329
}
2430

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

0 commit comments

Comments
 (0)