mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 03:12:15 +00:00
refactor(core): Make Logger a service (no-changelog) (#7494)
This commit is contained in:
committed by
GitHub
parent
db4e61ba24
commit
05586a900d
@@ -3,8 +3,9 @@ import { mkdir, utimes, open, rm } from 'fs/promises';
|
||||
import { join, dirname } from 'path';
|
||||
import { Container } from 'typedi';
|
||||
import { InstanceSettings } from 'n8n-core';
|
||||
import { LoggerProxy, sleep } from 'n8n-workflow';
|
||||
import { sleep } from 'n8n-workflow';
|
||||
import { inProduction } from '@/constants';
|
||||
import { Logger } from '@/Logger';
|
||||
|
||||
export const touchFile = async (filePath: string): Promise<void> => {
|
||||
await mkdir(dirname(filePath), { recursive: true });
|
||||
@@ -25,7 +26,7 @@ export const init = async () => {
|
||||
|
||||
if (existsSync(journalFile)) {
|
||||
// Crash detected
|
||||
LoggerProxy.error('Last session crashed');
|
||||
Container.get(Logger).error('Last session crashed');
|
||||
// add a 10 seconds pause to slow down crash-looping
|
||||
await sleep(10_000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user