feat(core): Add Job Summary to Worker response (#7360)

This commit is contained in:
Michael Auerswald
2023-10-06 17:52:27 +02:00
committed by GitHub
parent c8c14ca0af
commit b8608cee6d
8 changed files with 58 additions and 14 deletions

View File

@@ -1,6 +1,7 @@
import { LoggerProxy, jsonParse } from 'n8n-workflow';
import type { RedisServiceCommandObject } from '../redis/RedisServiceCommands';
import { COMMAND_REDIS_CHANNEL } from '../redis/RedisServiceHelper';
import * as os from 'os';
export interface RedisServiceCommandLastReceived {
[date: string]: Date;
@@ -31,3 +32,9 @@ export function debounceMessageReceiver(message: RedisServiceCommandObject, time
lastReceived[message.command] = now;
return true;
}
export function getOsCpuString(): string {
const cpus = os.cpus();
if (cpus.length === 0) return 'no CPU info';
return `${cpus.length}x ${cpus[0].model} - speed: ${cpus[0].speed}`;
}