Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
feat: handle SIGHUP
Browse files Browse the repository at this point in the history
  • Loading branch information
dryajov authored and daviddias committed Apr 24, 2018
1 parent 37801c1 commit 7a817cf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/cli/commands/daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,6 @@ module.exports = {
// listen for graceful termination
process.on('SIGTERM', cleanup)
process.on('SIGINT', cleanup)
process.on('SIGHUP', cleanup)
}
}
8 changes: 8 additions & 0 deletions test/cli/daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ describe('daemon', () => {
}).catch(done)
})

skipOnWindows('should handle SIGHUP gracefully', function (done) {
this.timeout(100 * 1000)

testSignal(ipfs, 'SIGHUP').then(() => {
checkLock(repoPath, done)
}).catch(done)
})

it('gives error if user hasn\'t run init before', function (done) {
this.timeout(100 * 1000)

Expand Down

0 comments on commit 7a817cf

Please sign in to comment.