Skip to content

Commit 32d167d

Browse files
authored
Merge pull request #26 from TrueSelph/0.1.11
Increase timeouts and enhance logging
2 parents c3b97e1 + ec8a8fc commit 32d167d

File tree

4 files changed

+21
-7
lines changed

4 files changed

+21
-7
lines changed

deepdoc_client_action/CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,7 @@
7171

7272
# 0.1.10
7373
- Bugfix in deepdoc_callback
74-
- Updated docs
74+
- Updated docs
75+
76+
# 0.1.11
77+
- Increase timeout and add logs

deepdoc_client_action/app/app.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def render(router: StreamlitRouter, agent_id: str, action_id: str, info: dict) -
181181
result = call_api(
182182
endpoint="action/walker/deepdoc_client_action/add_documents",
183183
files=files,
184-
timeout=60,
184+
timeout=120,
185185
)
186186
if result.status_code == 422:
187187
error_detail = result.json().get(
@@ -309,6 +309,7 @@ def get_status_badge(status: str) -> str:
309309
"per_page": st.session_state.per_page,
310310
"reporting": True,
311311
},
312+
timeout=120,
312313
)
313314

314315
if result and result.status_code == 200:
@@ -371,6 +372,7 @@ def get_status_badge(status: str) -> str:
371372
call_api(
372373
endpoint="action/walker/deepdoc_client_action/retrieve_job",
373374
json_data={"agent_id": agent_id, "job_id": job_id},
375+
timeout=120,
374376
)
375377
st.rerun()
376378
else:
@@ -420,6 +422,7 @@ def get_status_badge(status: str) -> str:
420422
"agent_id": agent_id,
421423
"job_id": job_id,
422424
},
425+
timeout=120,
423426
)
424427
if (
425428
cancel_result
@@ -469,6 +472,7 @@ def get_status_badge(status: str) -> str:
469472
"agent_id": agent_id,
470473
"job_id": job_id,
471474
},
475+
timeout=120,
472476
)
473477
if (
474478
delete_result
@@ -568,6 +572,7 @@ def get_status_badge(status: str) -> str:
568572
}
569573
],
570574
},
575+
timeout=120,
571576
)
572577
if delete_result:
573578
st.session_state.confirm_state = {

deepdoc_client_action/deepdoc_client_action.jac

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ node DeepDocClientAction(Action) {
5656
};
5757
}
5858
try {
59-
response = requests.get(f"{self.api_url}/health");
59+
response = requests.get(f"{self.api_url}/health", timeout=1440);
6060
return response.status_code == 200;
6161
} except Exception as e {
6262
self.logger.error(traceback.format_exc());
@@ -151,7 +151,8 @@ node DeepDocClientAction(Action) {
151151
response = requests.post(
152152
f"{self.api_url}/upload_and_chunk",
153153
files=files_data,
154-
data=payload
154+
data=payload,
155+
timeout=1440
155156
);
156157

157158
if not response {
@@ -255,7 +256,7 @@ node DeepDocClientAction(Action) {
255256
# """
256257
try {
257258
# Make the GET request to the DeepDoc service
258-
response = requests.get(f"{self.api_url}/job/{job_id}");
259+
response = requests.get(f"{self.api_url}/job/{job_id}", timeout=1440);
259260

260261
# Check if the response is successful
261262
if response.status_code != 200 {
@@ -287,6 +288,8 @@ node DeepDocClientAction(Action) {
287288

288289
job_data = self.get_job_status(job_id=job_id);
289290
job_entry = self.get_job_entry(job_id=job_id);
291+
job_data["job_id"] = job_id;
292+
self.logger.info(f"DeepDoc job result:{job_data}");
290293

291294
if not job_data or not job_entry {
292295
self.logger.error("DeepDoc job data is incomplete or missing");
@@ -300,6 +303,9 @@ node DeepDocClientAction(Action) {
300303
}
301304

302305
job_status = job_data.get("status");
306+
if job_status in ["cancelled"] {
307+
self.cancel_job(job_id);
308+
}
303309

304310
if job_status in ["failed", "error"] {
305311
self.logger.error(f"Job {job_id} failed with status: {job_status}");
@@ -357,7 +363,7 @@ node DeepDocClientAction(Action) {
357363
# """
358364
try {
359365
# Make the GET request to the DeepDoc service
360-
response = requests.post(f"{self.api_url}/job/{job_id}/cancel");
366+
response = requests.post(f"{self.api_url}/job/{job_id}/cancel", timeout=1440);
361367

362368
# Check if the response is successful
363369
if response.status_code != 200 {

deepdoc_client_action/info.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package:
22
name: jivas/deepdoc_client_action
33
author: V75 Inc.
44
archetype: DeepDocClientAction
5-
version: 0.1.10
5+
version: 0.1.11
66
meta:
77
title: DeepDoc Client Action
88
description: Integrates with DeepDoc OCR and document parsing services to ingest documents into a vector store

0 commit comments

Comments
 (0)