Skip to content
This repository was archived by the owner on Sep 27, 2021. It is now read-only.

Commit 6fe693e

Browse files
committed
reduce with initial value
1 parent a54c4a7 commit 6fe693e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ router.get('/stats', async ctx => {
136136
const usersPerMinute = usersT.length;
137137

138138
const reposPerMinute = (await Promise.all(usersT.map(async user => Number(await redis.get(`user:${user}`)))))
139-
.reduce((a, b) => a + b);
139+
.reduce((a, b) => a + b, 0);
140140

141141
ctx.body = {
142142
storage: prettyBytes(Number(await redis.get('stats:storage')), n => Number.parseFloat(n).toFixed(1)),

0 commit comments

Comments
 (0)