Skip to content

Commit

Permalink
fix(uptime): Round uptime seconds value to whole seconds
Browse files Browse the repository at this point in the history
Fixes #807
  • Loading branch information
Göran Sander committed May 20, 2024
1 parent 45822c5 commit 16097a0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/service_uptime.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ function serviceUptimeStart() {
const uptimeMilliSec = Date.now() - startTime;

const d = luxon.Duration.fromMillis(uptimeMilliSec).toFull().toObject();
// Round to whole seconds
d.seconds = Math.round(d.seconds);
const uptimeString = `${d.months} months, ${d.days} days, ${d.hours} hours, ${d.minutes} minutes, ${d.seconds} seconds`;

const { heapTotal } = process.memoryUsage();
Expand Down

0 comments on commit 16097a0

Please sign in to comment.