Skip to content

Commit

Permalink
add success status to "safe close" (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarcisiozf authored Aug 23, 2022
1 parent 2de38d5 commit 9f12516
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions lib/ws_servers/api/handlers/on_safe_close.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,15 @@ module.exports = async (server, session) => {
}
}

await Promise.allSettled(tasks)
const results = await Promise.allSettled(tasks)
let success = true

send(session, ['app.can_be_closed', true])
results.forEach(result => {
if (result.status === 'rejected') {
success = false
console.error('failed to stop', result.reason)
}
})

send(session, ['app.can_be_closed', success])
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bfx-hf-server",
"version": "7.6.0",
"version": "7.6.1",
"description": "HF server bundle",
"author": "Bitfinex",
"license": "Apache-2.0",
Expand Down

0 comments on commit 9f12516

Please sign in to comment.