-
Notifications
You must be signed in to change notification settings - Fork 90
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
onSuccess Fires Early (and often) #76
Comments
I think two things are happening: 1- Reloading before success: onSuccess is responsible for updating the UI (turning the bar green). You override onSuccess, so the task is finished but the UI isn't updated. To preserve the default behaviour when overriding, call this.onSuccessDefault in your custom handler and give it all the arguments. Like this:
2- Continuous reloading: The task result is still stored in the backend. So when the frontend asks for task status, it finds that the task finished successfully and triggers the onSuccess handler which causes reloading. So everything is working as expected. What's your desired behaviour? |
Thank you very much for your prompt response. With respect to the continuous reloading, that makes perfect sense; the task result is SUCCESS so it will fire the onSuccess handler upon page load. I added some logic to check for the presence of a different UI element to determine whether the page had already reloaded, which solved that issue. With respect tot he default handler, though, I am now receiving an error stating that this.onSuccessDefault does not exist. My script is now:
and the error received is:
|
works great! Thanks! |
Sorry about that! I just pushed a new release ( |
I use the following to display the progress bar, and the page refreshes constantly during the "crawl" of the progress bar and then continues to refresh indefinitely after the Celery task has completed. Perhaps my syntax is wrong?
I am using django-celery-results as well, if that matters.
Thank you for the hard work on this application!
The text was updated successfully, but these errors were encountered: