diff options
author | Chocobozzz <me@florianbigard.com> | 2020-12-30 14:29:17 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-12-30 14:29:17 +0100 |
commit | cc49be3e3547703d00ef7363d664221a39334ca3 (patch) | |
tree | 4a7bfc036164b642bb67a4d26c05eb33d2343e13 /server/lib/redis.ts | |
parent | 1227fe070e60b41731900c7712454c1409e6c025 (diff) | |
download | PeerTube-cc49be3e3547703d00ef7363d664221a39334ca3.tar.gz PeerTube-cc49be3e3547703d00ef7363d664221a39334ca3.tar.zst PeerTube-cc49be3e3547703d00ef7363d664221a39334ca3.zip |
Fix views processing hour 0
Diffstat (limited to 'server/lib/redis.ts')
-rw-r--r-- | server/lib/redis.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/server/lib/redis.ts b/server/lib/redis.ts index 4325598b2..257cce141 100644 --- a/server/lib/redis.ts +++ b/server/lib/redis.ts | |||
@@ -215,7 +215,7 @@ class Redis { | |||
215 | } | 215 | } |
216 | 216 | ||
217 | private generateVideoViewKey (videoId: number, hour?: number) { | 217 | private generateVideoViewKey (videoId: number, hour?: number) { |
218 | if (!hour) hour = new Date().getHours() | 218 | if (hour === undefined || hour === null) hour = new Date().getHours() |
219 | 219 | ||
220 | return `video-view-${videoId}-h${hour}` | 220 | return `video-view-${videoId}-h${hour}` |
221 | } | 221 | } |