Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2015-12-19 06:04:09 +0300
committerFeross Aboukhadijeh <feross@feross.org>2015-12-27 23:17:14 +0300
commitd5ba4e0260d21657780c065c71ed3c5648df5944 (patch)
tree80414c9ad2671e62f9d323b0485f4c50b948f75c /bin
parent13eaafed2c0563da0d94778d5e22f1bf1f37fb5c (diff)
style
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cmd.js20
1 files changed, 11 insertions, 9 deletions
diff --git a/bin/cmd.js b/bin/cmd.js
index 52a34a5..f65452f 100755
--- a/bin/cmd.js
+++ b/bin/cmd.js
@@ -617,13 +617,15 @@ function gracefulExit () {
clivas.line('\n{green:webtorrent is gracefully exiting...}')
- if (client) {
- if (argv['on-exit']) cp.exec(argv['on-exit']).unref()
- client.destroy(function (err) {
- if (err) return fatalError(err)
- // Quit after 1 second. This shouldn't be necessary, node never quits even though
- // there's nothing in the event loop when `wrtc` (webtorrent-hybrid) is used :(
- setTimeout(function () { process.exit(0) }, 1000).unref()
- })
- }
+ if (!client) return
+
+ if (argv['on-exit']) cp.exec(argv['on-exit']).unref()
+
+ client.destroy(function (err) {
+ if (err) return fatalError(err)
+
+ // Quit after 1 second. This is only necessary for `webtorrent-hybrid` since
+ // the `wrtc` package makes node never quit :(
+ setTimeout(function () { process.exit(0) }, 1000).unref()
+ })
}