Skip to content

Commit

Permalink
fix: Fix query awaited endpoint (#29225)
Browse files Browse the repository at this point in the history
  • Loading branch information
timgl authored Feb 26, 2025
1 parent 739c08e commit d301bcb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions frontend/src/queries/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ async function executeQuery<N extends DataNode>(
onerror(err) {
abortController.abort()
reject(err)
throw err // make sure fetchEventSource doesn't attempt to retry
},
}).catch(reject)
})
Expand Down
3 changes: 2 additions & 1 deletion posthog/api/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ async def event_stream():
status = await sync_to_async(manager.get_clickhouse_progresses)()

if isinstance(status, BaseModel):
yield f"data: {status.model_dump_json(by_alias=True)}\n\n".encode()
status_update = {"complete": False, **status.model_dump(by_alias=True)}
yield f"data: {json.dumps(status_update)}\n\n".encode()
last_update_time = current_time
# Just ignore errors when getting progress, shouldn't impact users
except Exception as e:
Expand Down

0 comments on commit d301bcb

Please sign in to comment.