mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-03 22:15:37 +00:00
fix: more annotation for util functions
This commit is contained in:
1 parent
1ae9503477
commit
39e818283d
5 files changed
+64
-27
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import loggerModule from '../../services/logger';
|
||||
import { GetUptimeFormattedParams } from '../../types/utilTypes';
|
||||
|
||||
export const getUptimeFormatted = async ({ executionId }) => {
|
||||
export const getUptimeFormatted = async ({ executionId }: GetUptimeFormattedParams) => {
|
||||
const logger = loggerModule.child({
|
||||
source: 'getUptimeFormatted.js',
|
||||
module: 'utilSystem',
|
||||
@@ -11,9 +12,9 @@ export const getUptimeFormatted = async ({ executionId }) => {
|
||||
try {
|
||||
let uptimeFormattedString = '';
|
||||
|
||||
const uptimeInSeconds = process.uptime();
|
||||
const uptimeInSeconds = parseFloat(process.uptime().toFixed(0));
|
||||
const uptimeDate = new Date(0);
|
||||
uptimeDate.setSeconds(uptimeInSeconds.toFixed(0));
|
||||
uptimeDate.setSeconds(uptimeInSeconds);
|
||||
uptimeFormattedString = `${
|
||||
uptimeDate.getUTCDate() - 1
|
||||
}d ${uptimeDate.getUTCHours()}h ${uptimeDate.getUTCMinutes()}m ${uptimeDate.getUTCSeconds()}s`;
|
||||
|
||||
Reference in new issue
Block a user