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

update_progress #104

Open
diegofcoelho opened this issue Oct 19, 2017 · 2 comments
Open

update_progress #104

diegofcoelho opened this issue Oct 19, 2017 · 2 comments

Comments

@diegofcoelho
Copy link
Contributor

Hey Chris,

I tried to implement update_progress in a task but nothing really happens...

From your source code, it seems like I can you the code straight from your example:

Job.update_progress(total_parts=pckg_size, total_parts_complete=pckg_completed)

So I just want to make sure that it cant be used as in the lines below:
job_obj = Job.objects.get(pk=9)
job_obj.update_progress(total_parts=pckg_size, total_parts_complete=pckg_completed)

Nevertheless, I can't make it work...

@chrisspen
Copy link
Owner

Make sure you're committing the transaction. If you have your code in a transaction, then the progress update won't be sent to the serve until the transaction is committed.

@diegofcoelho
Copy link
Contributor Author

Somehow the pool of threads that I created inside the Job can't access the Job object itself. Otherwise it does work...

Is there a way to force the committing? (sorry for the newbie questions)

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

No branches or pull requests

2 participants