mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 19:00:59 +03:00
Chore/leave default timeout for sandbox execution (#5263)
leave default timeout for sandbox execution
This commit is contained in:
@@ -940,9 +940,7 @@ const getReturnOutput = async (nodeData: INodeData, input: string, options: ICom
|
||||
const sandbox = createCodeExecutionSandbox(input, variables, flow)
|
||||
|
||||
try {
|
||||
const response = await executeJavaScriptCode(updateStateMemoryCode, sandbox, {
|
||||
timeout: 10000
|
||||
})
|
||||
const response = await executeJavaScriptCode(updateStateMemoryCode, sandbox)
|
||||
|
||||
if (typeof response !== 'object') throw new Error('Return output must be an object')
|
||||
return response
|
||||
|
||||
@@ -282,9 +282,7 @@ const runCondition = async (nodeData: INodeData, input: string, options: ICommon
|
||||
const sandbox = createCodeExecutionSandbox(input, variables, flow)
|
||||
|
||||
try {
|
||||
const response = await executeJavaScriptCode(conditionFunction, sandbox, {
|
||||
timeout: 10000
|
||||
})
|
||||
const response = await executeJavaScriptCode(conditionFunction, sandbox)
|
||||
|
||||
if (typeof response !== 'string') throw new Error('Condition function must return a string')
|
||||
return response
|
||||
|
||||
@@ -549,9 +549,7 @@ const runCondition = async (
|
||||
const sandbox = createCodeExecutionSandbox(input, variables, flow)
|
||||
|
||||
try {
|
||||
const response = await executeJavaScriptCode(conditionFunction, sandbox, {
|
||||
timeout: 10000
|
||||
})
|
||||
const response = await executeJavaScriptCode(conditionFunction, sandbox)
|
||||
|
||||
if (typeof response !== 'string') throw new Error('Condition function must return a string')
|
||||
return response
|
||||
|
||||
@@ -166,9 +166,7 @@ class CustomFunction_SeqAgents implements INode {
|
||||
const sandbox = createCodeExecutionSandbox(input, variables, flow, additionalSandbox)
|
||||
|
||||
try {
|
||||
const response = await executeJavaScriptCode(javascriptFunction, sandbox, {
|
||||
timeout: 10000
|
||||
})
|
||||
const response = await executeJavaScriptCode(javascriptFunction, sandbox)
|
||||
|
||||
if (returnValueAs === 'stateObj') {
|
||||
if (typeof response !== 'object') {
|
||||
|
||||
@@ -264,8 +264,7 @@ class ExecuteFlow_SeqAgents implements INode {
|
||||
|
||||
try {
|
||||
let response = await executeJavaScriptCode(code, sandbox, {
|
||||
useSandbox: false,
|
||||
timeout: 10000
|
||||
useSandbox: false
|
||||
})
|
||||
|
||||
if (typeof response === 'object') {
|
||||
|
||||
@@ -712,9 +712,7 @@ const getReturnOutput = async (nodeData: INodeData, input: string, options: ICom
|
||||
const sandbox = createCodeExecutionSandbox(input, variables, flow)
|
||||
|
||||
try {
|
||||
const response = await executeJavaScriptCode(updateStateMemoryCode, sandbox, {
|
||||
timeout: 10000
|
||||
})
|
||||
const response = await executeJavaScriptCode(updateStateMemoryCode, sandbox)
|
||||
|
||||
if (typeof response !== 'object') throw new Error('Return output must be an object')
|
||||
return response
|
||||
|
||||
@@ -204,9 +204,7 @@ class State_SeqAgents implements INode {
|
||||
const sandbox = createCodeExecutionSandbox('', variables, flow)
|
||||
|
||||
try {
|
||||
const response = await executeJavaScriptCode(`return ${stateMemoryCode}`, sandbox, {
|
||||
timeout: 10000
|
||||
})
|
||||
const response = await executeJavaScriptCode(`return ${stateMemoryCode}`, sandbox)
|
||||
|
||||
if (typeof response !== 'object') throw new Error('State must be an object')
|
||||
const returnOutput: ISeqAgentNode = {
|
||||
|
||||
@@ -575,9 +575,7 @@ const getReturnOutput = async (
|
||||
const sandbox = createCodeExecutionSandbox(input, variables, flow)
|
||||
|
||||
try {
|
||||
const response = await executeJavaScriptCode(updateStateMemoryCode, sandbox, {
|
||||
timeout: 10000
|
||||
})
|
||||
const response = await executeJavaScriptCode(updateStateMemoryCode, sandbox)
|
||||
|
||||
if (typeof response !== 'object') throw new Error('Return output must be an object')
|
||||
return response
|
||||
|
||||
@@ -396,9 +396,7 @@ export const checkMessageHistory = async (
|
||||
const sandbox = createCodeExecutionSandbox('', variables, flow)
|
||||
|
||||
try {
|
||||
const response = await executeJavaScriptCode(messageHistory, sandbox, {
|
||||
timeout: 10000
|
||||
})
|
||||
const response = await executeJavaScriptCode(messageHistory, sandbox)
|
||||
|
||||
if (!Array.isArray(response)) throw new Error('Returned message history must be an array')
|
||||
if (sysPrompt) {
|
||||
|
||||
Reference in New Issue
Block a user