diff options
Diffstat (limited to 'server/helpers/utils.js')
-rw-r--r-- | server/helpers/utils.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/server/helpers/utils.js b/server/helpers/utils.js index 9f4b14582..6d40e8f3f 100644 --- a/server/helpers/utils.js +++ b/server/helpers/utils.js | |||
@@ -6,6 +6,7 @@ const logger = require('./logger') | |||
6 | 6 | ||
7 | const utils = { | 7 | const utils = { |
8 | badRequest, | 8 | badRequest, |
9 | createEmptyCallback, | ||
9 | cleanForExit, | 10 | cleanForExit, |
10 | generateRandomString, | 11 | generateRandomString, |
11 | isTestInstance, | 12 | isTestInstance, |
@@ -29,6 +30,12 @@ function cleanForExit (webtorrentProcess) { | |||
29 | process.kill(-webtorrentProcess.pid) | 30 | process.kill(-webtorrentProcess.pid) |
30 | } | 31 | } |
31 | 32 | ||
33 | function createEmptyCallback () { | ||
34 | return function (err) { | ||
35 | if (err) logger.error('Error in empty callback.', { error: err }) | ||
36 | } | ||
37 | } | ||
38 | |||
32 | function isTestInstance () { | 39 | function isTestInstance () { |
33 | return (process.env.NODE_ENV === 'test') | 40 | return (process.env.NODE_ENV === 'test') |
34 | } | 41 | } |