Skip to content

Commit 06d9549

Browse files
committed
Add connection close statements to handle exceptions in ApiProcessorInterface
1 parent 5b8f621 commit 06d9549

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llmstack/processors/providers/api_processor_interface.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import jinja2
66
import ujson as json
7+
from django.db import connections
78
from pydantic import AnyUrl, BaseModel
89

910
from llmstack.apps.schemas import OutputTemplate
@@ -119,8 +120,11 @@ def _upload_asset_from_url(self, asset):
119120
)
120121
except Exception as e:
121122
logger.exception(e)
123+
connections.close_all()
122124
return asset
123125

126+
connections.close_all()
127+
124128
return f"objref://sessionfiles/{asset.uuid}"
125129

126130
def __init__(

0 commit comments

Comments
 (0)