refactor(core): Rename some runners files and classes for clarity (#12410)

This commit is contained in:
Iván Ovejero
2024-12-31 12:21:04 +01:00
committed by GitHub
parent 0860fbe971
commit 096329db51
51 changed files with 85 additions and 83 deletions

View File

@@ -0,0 +1,34 @@
import type { TaskRunner } from '@n8n/task-runner';
import { ApplicationError } from 'n8n-workflow';
export class TaskRunnerDisconnectedError extends ApplicationError {
description: string;
constructor(
readonly runnerId: TaskRunner['id'],
isCloudDeployment: boolean,
) {
super('Node execution failed');
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 can happen for various reasons. Please try executing the node again. If the problem persists, 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;
}
}