Do not attempt to close server before it's up

This commit is contained in:
Zaid Abdulla committed 2017-01-01 17:31:31 -08:00
1 parent 7644d46f6b
commit d82c2bb350
2 files changed
+9 -3

No files matched your search

+7 -1
View File
@@ -41,6 +41,12 @@ exit = () ->
, 30000).unref()
cluster.worker?.disconnect()
if not server
db.disconnect()
extensions.killAll()
return
server.close(() ->
db.disconnect()
extensions.killAll()
@@ -52,7 +58,7 @@ process.on('uncaughtException', (err) ->
util.error("#{new Date().toISOString()} - #{err.stack}\n")
exit()
catch err
util.error("#{new Date().toISOString()} - #{err2.stack}\n")
util.error("#{new Date().toISOString()} - #{err.stack}\n")
throw err
)