mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-03 14:38:49 +00:00
fix!: New folder structure and organize files
This commit is contained in:
1 parent
d92bd329dc
commit
39ff5ecb5d
83 files changed
+244
-246
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import { Logger } from 'pino';
|
||||
import loggerModule from '../services/logger';
|
||||
import { GetUptimeFormattedParams } from '../../types/utilTypes';
|
||||
import { formatDuration } from './formattingUtils';
|
||||
|
||||
export const getUptimeFormatted = ({ executionId }: GetUptimeFormattedParams): string => {
|
||||
const logger: Logger = loggerModule.child({
|
||||
module: 'utilSystem',
|
||||
name: 'getUptimeFormatted',
|
||||
executionId: executionId
|
||||
});
|
||||
|
||||
try {
|
||||
const uptimeInSeconds: number = parseFloat(process.uptime().toFixed(0));
|
||||
return formatDuration(uptimeInSeconds * 1000);
|
||||
} catch (error) {
|
||||
logger.error('Error retrieving or transforming uptime to formatted string.', error);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user