Skip to content
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

redirect upon task completion #38

Closed
mattschwen opened this issue Jun 24, 2020 · 3 comments
Closed

redirect upon task completion #38

mattschwen opened this issue Jun 24, 2020 · 3 comments
Labels
question Further information is requested

Comments

@mattschwen
Copy link

Hello,

I am looking for a way to issue a redirect if the task completes as success or failure within the JavaScript itself.

I have the status bar working, and it's awesome. However, I have a list of 2 separate tasks. I want to submit one task, wait for the completion while viewing this nice status bar, then once complete (if successful) kickstart the second task and wait for that nice status bar to finish.

@czue
Copy link
Owner

czue commented Jun 25, 2020

Hey! This should be possible with a custom onSuccess function. Basically you should be able to initialize the library with

  CeleryProgressBar.initProgressBar(progressUrl, {
    // other arguments
    onSuccess: function () { window.location.href = '/your/redirect/'; }
  }

or if you want to call a second task, you'd just do the same in the onSuccess.

Does that suit your use case?

@czue czue added the question Further information is requested label Jun 25, 2020
@eeintech
Copy link
Contributor

eeintech commented Aug 6, 2020

@czue No activity from OP, I think your answer covers his question, consider closing the issue?

@czue
Copy link
Owner

czue commented Aug 6, 2020

@eeintech good call!

@czue czue closed this as completed Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants