Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -171,7 +171,7 @@ async def endpoint_output(endpoint_result: ResultItem, code: int = 0, error: str
|
|
171 |
|
172 |
|
173 |
# Caching Post requests is challenging
|
174 |
-
async def sms_posts(instance:
|
175 |
async with AsyncSession(sms_resource["engine"]) as session:
|
176 |
|
177 |
code = 1
|
@@ -197,7 +197,7 @@ async def sms_posts(instance: Result, idx: str = None, action: str = "add") -> U
|
|
197 |
error = str(e)
|
198 |
|
199 |
finally:
|
200 |
-
return await endpoint_output(result, code, error)
|
201 |
|
202 |
|
203 |
# @cache(expire=ONE_DAY_SEC, namespace='sms_gets') # Cache for 1 day
|
|
|
171 |
|
172 |
|
173 |
# Caching Post requests is challenging
|
174 |
+
async def sms_posts(instance: ResultItem, idx: str = None, action: str = "add") -> Union[ErrorResponse, EndpointResponse]:
|
175 |
async with AsyncSession(sms_resource["engine"]) as session:
|
176 |
|
177 |
code = 1
|
|
|
197 |
error = str(e)
|
198 |
|
199 |
finally:
|
200 |
+
return await endpoint_output(ResultItem(result), code, error)
|
201 |
|
202 |
|
203 |
# @cache(expire=ONE_DAY_SEC, namespace='sms_gets') # Cache for 1 day
|