Skip to content

Commit 9a1691d

Browse files
committed
Add Hosts DayMap --fix :sad: :sad:
1 parent a7f8d07 commit 9a1691d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/controllers/status.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,16 @@ async function getHostsDayMap (limitHosts, now) {
7272
events.push(cache.get('requests:hosts:count:' + (ts - index * 60 * 60).toString()))
7373
}
7474
const result = await Promise.all(events)
75-
const data = []
75+
const data = {}
7676
for (let host of limitHosts) {
7777
const _ = result[0] ? now[host] - parseInt(result[0][host]) : 0
78-
data.push(_)
78+
data[host] = []
79+
data[host].push(_)
7980
}
8081
for (let index = 0; index < (result.length - 2); index++) {
8182
for (let host of limitHosts) {
8283
const _ = result[index] ? parseInt(result[index][host]) - parseInt(result[index + 1][host]) : null
83-
data.push(_)
84+
data[host].push(_)
8485
}
8586
}
8687
return data

0 commit comments

Comments
 (0)