mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 18:41:14 +00:00
refactor(core): Rename some runners files and classes for clarity (#12410)
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { ApplicationError } from 'n8n-workflow';
|
||||
|
||||
import type { TaskRunner } from '../task-broker.service';
|
||||
|
||||
export class TaskRunnerOomError extends ApplicationError {
|
||||
description: string;
|
||||
|
||||
constructor(
|
||||
readonly runnerId: TaskRunner['id'],
|
||||
isCloudDeployment: boolean,
|
||||
) {
|
||||
super('Node ran out of memory.', { level: 'error' });
|
||||
|
||||
const fixSuggestions = {
|
||||
reduceItems:
|
||||
'Reduce the number of items processed at a time, by batching them using a loop node',
|
||||
increaseMemory:
|
||||
"Increase the memory available to the task runner with 'N8N_RUNNERS_MAX_OLD_SPACE_SIZE' environment variable",
|
||||
upgradePlan: 'Upgrade your cloud plan to increase the available memory',
|
||||
};
|
||||
|
||||
const subtitle =
|
||||
'This usually happens when there are too many items to process. You can try the following:';
|
||||
const suggestions = isCloudDeployment
|
||||
? [fixSuggestions.reduceItems, fixSuggestions.upgradePlan]
|
||||
: [fixSuggestions.reduceItems, fixSuggestions.increaseMemory];
|
||||
const suggestionsText = suggestions
|
||||
.map((suggestion, index) => `${index + 1}. ${suggestion}`)
|
||||
.join('<br/>');
|
||||
|
||||
const description = `${subtitle}<br/><br/>${suggestionsText}`;
|
||||
|
||||
this.description = description;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user