Added some delay before listening for connection to avoid handling requests before DB connections are established.
This commit is contained in:
1 parent
2839d27a8e
commit
993472e2ca
1 file changed
+3
-2
+3
-2
@@ -278,7 +278,6 @@ nextTask = (currentRequest) ->
|
|||||||
|
|
||||||
listener = (httpRequest, httpResponse) ->
|
listener = (httpRequest, httpResponse) ->
|
||||||
if httpRequest.method != 'POST'
|
if httpRequest.method != 'POST'
|
||||||
#console.log '>>> 405 Method Not Allowed'
|
|
||||||
httpResponse.writeHead 405, {'Allow': 'POST'}
|
httpResponse.writeHead 405, {'Allow': 'POST'}
|
||||||
httpResponse.end('405 Method Not Allowed')
|
httpResponse.end('405 Method Not Allowed')
|
||||||
return
|
return
|
||||||
@@ -450,6 +449,8 @@ else
|
|||||||
httpServer = http.createServer(listener)
|
httpServer = http.createServer(listener)
|
||||||
httpsServer = https.createServer(options, listener)
|
httpsServer = https.createServer(options, listener)
|
||||||
|
|
||||||
|
# wait until DB connections are established
|
||||||
|
setTimeout(() ->
|
||||||
httpServer.listen(config.ACS_PORT, config.ACS_INTERFACE)
|
httpServer.listen(config.ACS_PORT, config.ACS_INTERFACE)
|
||||||
httpsServer.listen(config.ACS_HTTPS_PORT, config.ACS_HTTPS_INTERFACE)
|
httpsServer.listen(config.ACS_HTTPS_PORT, config.ACS_HTTPS_INTERFACE)
|
||||||
#console.log "Server listening on port #{config.ACS_PORT}"
|
, 1000)
|
||||||
Reference in new issue
Block a user