aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/utils.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-02-26 18:57:33 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-02-26 20:01:26 +0100
commite4c87ec26962e359d1c70b03ed188a3f19d6a25b (patch)
tree26fe20e6f600bc6f6f569dde2171b0a2346b135c /server/helpers/utils.js
parent9e167724f7e933f41d9ea2e1c31772bf4c560a28 (diff)
downloadPeerTube-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.js7
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
7const utils = { 7const 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
33function createEmptyCallback () {
34 return function (err) {
35 if (err) logger.error('Error in empty callback.', { error: err })
36 }
37}
38
32function isTestInstance () { 39function isTestInstance () {
33 return (process.env.NODE_ENV === 'test') 40 return (process.env.NODE_ENV === 'test')
34} 41}