fix!: New folder structure and organize files

This commit is contained in:
Marius Begby committed 2024-01-30 16:29:17 +01:00
1 parent d92bd329dc
commit 39ff5ecb5d
83 files changed
+244 -246

No files matched your search

+20
View File
@@ -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;
}
};