mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
clean up implementation
This commit is contained in:
parent
6678249f58
commit
13efb7fcce
|
@ -307,7 +307,11 @@ export class LoadNodesAndCredentials {
|
|||
for (const usableNode of usableNodes) {
|
||||
const description: INodeTypeBaseDescription | INodeTypeDescription =
|
||||
structuredClone(usableNode);
|
||||
const nodeType = this.getCurrentVersionNodeType(usableNode);
|
||||
|
||||
// avoid spiking memory during startup, loading all node classes into memory
|
||||
const nodeType = usableNode.usableAsTool
|
||||
? this.getCurrentVersionNodeType(usableNode)
|
||||
: undefined;
|
||||
const wrapped = this.convertNodeToAiTool({
|
||||
description,
|
||||
setupAsTool: nodeType?.setupAsTool,
|
||||
|
|
|
@ -60,7 +60,6 @@ export class NodeTypes implements INodeTypes {
|
|||
}) as INodeTypeDescription;
|
||||
const clonedNode = Object.create(versionedNodeType, {
|
||||
description: { value: clonedDescription },
|
||||
setupAsTool: { value: versionedNodeType.setupAsTool },
|
||||
}) as INodeType;
|
||||
const tool = this.loadNodesAndCredentials.convertNodeToAiTool(clonedNode);
|
||||
loadedNodes[nodeType + 'Tool'] = { sourcePath: '', type: tool };
|
||||
|
|
Loading…
Reference in a new issue