diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-02-26 18:57:33 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-02-26 20:01:26 +0100 |
commit | e4c87ec26962e359d1c70b03ed188a3f19d6a25b (patch) | |
tree | 26fe20e6f600bc6f6f569dde2171b0a2346b135c /server/helpers/utils.js | |
parent | 9e167724f7e933f41d9ea2e1c31772bf4c560a28 (diff) | |
download | PeerTube-e4c87ec26962e359d1c70b03ed188a3f19d6a25b.tar.gz PeerTube-e4c87ec26962e359d1c70b03ed188a3f19d6a25b.tar.zst PeerTube-e4c87ec26962e359d1c70b03ed188a3f19d6a25b.zip |
Server: implement video views
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 | } |