aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-07-24 14:35:11 +0200
committerChocobozzz <me@florianbigard.com>2018-07-24 14:36:25 +0200
commit98d3324db3b1c345fc30e5dbcef3b1e11169867e (patch)
tree789b15539307a3671722ccce71f3b0de1a9dcc8a /server/helpers
parent3f6d68d9671ddb7ba1c4f3a35021b84856dafb6a (diff)
downloadPeerTube-98d3324db3b1c345fc30e5dbcef3b1e11169867e.tar.gz
PeerTube-98d3324db3b1c345fc30e5dbcef3b1e11169867e.tar.zst
PeerTube-98d3324db3b1c345fc30e5dbcef3b1e11169867e.zip
Fix nodeinfo endpoint
Diffstat (limited to 'server/helpers')
-rw-r--r--server/helpers/utils.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/server/helpers/utils.ts b/server/helpers/utils.ts
index 834d788c8..9efc89d92 100644
--- a/server/helpers/utils.ts
+++ b/server/helpers/utils.ts
@@ -113,7 +113,7 @@ const timeTable = {
113 week: 3600000 * 24 * 7, 113 week: 3600000 * 24 * 7,
114 month: 3600000 * 24 * 30 114 month: 3600000 * 24 * 30
115} 115}
116export function parseDuration (duration: number | string, defaultDuration: number): number { 116export function parseDuration (duration: number | string): number {
117 if (typeof duration === 'number') return duration 117 if (typeof duration === 'number') return duration
118 118
119 if (typeof duration === 'string') { 119 if (typeof duration === 'string') {
@@ -130,8 +130,7 @@ export function parseDuration (duration: number | string, defaultDuration: numbe
130 } 130 }
131 } 131 }
132 132
133 logger.error('Duration could not be properly parsed, defaulting to ' + defaultDuration) 133 throw new Error('Duration could not be properly parsed')
134 return defaultDuration
135} 134}
136 135
137function resetSequelizeInstance (instance: Model<any>, savedFields: object) { 136function resetSequelizeInstance (instance: Model<any>, savedFields: object) {