langgenius / langgenius/dify-sandbox

How to extend timeout

Open
#189 1 comment 3 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.3k
Forks
326
Avg merge
56m
Merged PRs (30d)
3

Description

This is my Python code. It is used to send network requests

```
import requests,json

API_KEY = ""
BASE_URL = "https://open.docmee.cn"

def main(taskid: str) -> dict:

url = f"{BASE_URL}/api/ppt/v2/generateContent"

payload = {
"id": taskid,
"stream": False,
"length": "short",
"lang": "zh",
# "prompt": ""
}

headers = {
"Content-Type": "application/json",
"token": API_KEY
}

try:
response = requests.post(
url,
headers=headers,
data=json.dumps(payload),
timeout=30000
)

if response.status_code != 200:
return {"result":None}

result = response.json()

if result.get("code") == 0:
markdown_text = result["data"]["text"]
return {
"result": markdown_text
}

else:
return {"result":None}

except requests.exceptions.RequestException as e:
return {"result":None}
except json.JSONDecodeError:
return {"result":None}
```

I get **Failed to parse execution result: Network or parsing error: error: timeout error: signal: killed , check sandbox service**

It seems that there is a timeout of 15 seconds. **How can I extend this timeout**

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the reported main function and its requests.post call, then trace how dify-sandbox handles execution timeouts for this request. Identify the setting or entry point that controls the 15-second limit and verify that a longer timeout is honored without the sandbox killing the process.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, python
Domain
backend, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.