M56: make RAGcore sync fail closed
This commit is contained in:
@@ -121,6 +121,14 @@
|
||||
"name": "source_id",
|
||||
"value": "={{ $json.id }}"
|
||||
},
|
||||
{
|
||||
"name": "external_id",
|
||||
"value": "={{ $json.document_id + '.md' }}"
|
||||
},
|
||||
{
|
||||
"name": "locale",
|
||||
"value": "={{ $json.language }}"
|
||||
},
|
||||
{
|
||||
"parameterType": "formBinaryData",
|
||||
"name": "file",
|
||||
@@ -150,7 +158,7 @@
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"jsCode": "const items = $input.all();\nlet synced = 0;\nlet failed = 0;\nfor (const item of items) {\n if (item.json && item.json.error) {\n failed += 1;\n } else {\n synced += 1;\n }\n}\nreturn [{ json: { execution_id: String($execution.id), synced, failed } }];"
|
||||
"jsCode": "const items = $input.all();\nlet synced = 0;\nlet failed = 0;\nfor (const item of items) {\n const body = item && item.json;\n const accepted = body && typeof body.job_id === 'string' && typeof body.status_url === 'string' && body.status_url.length > 0;\n if (accepted) {\n synced += 1;\n } else {\n failed += 1;\n }\n}\nreturn [{ json: { execution_id: String($execution.id), synced, failed } }];"
|
||||
},
|
||||
"type": "n8n-nodes-base.code",
|
||||
"typeVersion": 2,
|
||||
|
||||
Reference in New Issue
Block a user