Skip to content

Celery: cheat job_status view to return finished after 5 polls #10107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 6, 2023

Conversation

humitos
Copy link
Member

@humitos humitos commented Mar 6, 2023

The frontend hits this endpoint every 1s. As we don't know when the task has finished now since we disabled the Celery result backend, we are just cheating it and return finished after 5 times the view is called with the same task_id.

This fixes the issue we have in the UI when clicking the circled arrows to re-sync the remote repositories.

Closes #10068

@humitos humitos requested a review from agjohnson March 6, 2023 10:33
@humitos humitos requested a review from a team as a code owner March 6, 2023 10:33
@humitos humitos requested a review from stsewd March 6, 2023 10:33
The frontend hits this endpoint every 1s. As we don't know when the task has
finished now since we disabled the Celery result backend, we are just cheating
it and return finished after 5 times the view is called with the same `task_id`.

This fixes the issue we have in the UI when clicking the circled arrows to
re-sync the remote repositories.
@humitos humitos force-pushed the humitos/sync-repositories-button branch from bf3305e to 90b9b38 Compare March 6, 2023 10:35
Copy link
Contributor

@agjohnson agjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good hack! I was going to suggest doing something similar on the front end code. Easy wins here though, this code should be fairly short lived.

@humitos humitos enabled auto-merge (squash) March 6, 2023 17:36
@humitos humitos merged commit 6bb753a into main Mar 6, 2023
@humitos humitos deleted the humitos/sync-repositories-button branch March 6, 2023 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Project: remote repo sync button stops updating page
2 participants