1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 02:09:37 +02:00

Server: implement video views

This commit is contained in:
Chocobozzz 2017-02-26 18:57:33 +01:00
parent 9e167724f7
commit e4c87ec269
15 changed files with 612 additions and 48 deletions

View file

@ -6,6 +6,7 @@ const logger = require('./logger')
const utils = {
badRequest,
createEmptyCallback,
cleanForExit,
generateRandomString,
isTestInstance,
@ -29,6 +30,12 @@ function cleanForExit (webtorrentProcess) {
process.kill(-webtorrentProcess.pid)
}
function createEmptyCallback () {
return function (err) {
if (err) logger.error('Error in empty callback.', { error: err })
}
}
function isTestInstance () {
return (process.env.NODE_ENV === 'test')
}