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

Commit 7a817cf

Browse files
dryajovdaviddias
authored andcommitted
feat: handle SIGHUP
1 parent 37801c1 commit 7a817cf

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/cli/commands/daemon.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,6 @@ module.exports = {
5555
// listen for graceful termination
5656
process.on('SIGTERM', cleanup)
5757
process.on('SIGINT', cleanup)
58+
process.on('SIGHUP', cleanup)
5859
}
5960
}

test/cli/daemon.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ describe('daemon', () => {
110110
}).catch(done)
111111
})
112112

113+
skipOnWindows('should handle SIGHUP gracefully', function (done) {
114+
this.timeout(100 * 1000)
115+
116+
testSignal(ipfs, 'SIGHUP').then(() => {
117+
checkLock(repoPath, done)
118+
}).catch(done)
119+
})
120+
113121
it('gives error if user hasn\'t run init before', function (done) {
114122
this.timeout(100 * 1000)
115123

0 commit comments

Comments
 (0)