mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-11 08:57:17 +00:00
fix: record an error state when a timer's chat completion raises
This commit is contained in:
parent
810378c0b8
commit
44b1c7a0ec
1 changed files with 5 additions and 1 deletions
|
|
@ -405,7 +405,11 @@ async def execute_due_timer(app, timer_id: str, claim_id: str | None = None) ->
|
|||
)
|
||||
request.state.token = None
|
||||
request.state.enable_api_keys = False
|
||||
await app.state.CHAT_COMPLETION_HANDLER(request, form_data, user=user)
|
||||
try:
|
||||
await app.state.CHAT_COMPLETION_HANDLER(request, form_data, user=user)
|
||||
except Exception as exc:
|
||||
log.exception(f'Timer {timer_id} completion failed')
|
||||
await _set_timer_state(timer_id, 'error', timer_error=str(exc)[:500])
|
||||
|
||||
|
||||
async def _set_timer_state(timer_id: str, status: str, **fields) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue