Skip to content

Commit f353501

Browse files
committed
fix: fill in missing intervals in uptime rollup calculation
1 parent 0829e1d commit f353501

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

scripts/import-uptime.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,18 @@ const importUptime = async () => {
152152
})
153153
}
154154

155+
// fill in missing intervals
156+
for (let i = 0; i < 355; i++) {
157+
const interval = String(i)
158+
if (!rollup[interval]) {
159+
inserts.push({
160+
account,
161+
interval,
162+
online: false
163+
})
164+
}
165+
}
166+
155167
if (inserts.length) {
156168
logger(`saving ${inserts.length} rollups for ${account}`)
157169
await db('representatives_uptime_rollup_2hour')

0 commit comments

Comments
 (0)