mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 03:12:15 +00:00
fix: Enable crash journal only in production mode (no-changelog) (#4948)
* consolidate various `NODE_ENV` checks in the `cli` package * enable crash journal only in production
This commit is contained in:
committed by
GitHub
parent
2a7cb0192a
commit
323bd78067
@@ -3,6 +3,7 @@ import { mkdir, utimes, open, rm } from 'fs/promises';
|
||||
import { join, dirname } from 'path';
|
||||
import { UserSettings } from 'n8n-core';
|
||||
import { LoggerProxy, sleep } from 'n8n-workflow';
|
||||
import { inProduction } from '@/constants';
|
||||
|
||||
export const touchFile = async (filePath: string): Promise<void> => {
|
||||
await mkdir(dirname(filePath), { recursive: true });
|
||||
@@ -18,6 +19,8 @@ export const touchFile = async (filePath: string): Promise<void> => {
|
||||
const journalFile = join(UserSettings.getUserN8nFolderPath(), 'crash.journal');
|
||||
|
||||
export const init = async () => {
|
||||
if (!inProduction) return;
|
||||
|
||||
if (existsSync(journalFile)) {
|
||||
// Crash detected
|
||||
LoggerProxy.error('Last session crashed');
|
||||
|
||||
Reference in New Issue
Block a user