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

Uploading process and interrupt questions #19

Open
danrademacher opened this issue Jun 16, 2015 · 2 comments
Open

Uploading process and interrupt questions #19

danrademacher opened this issue Jun 16, 2015 · 2 comments
Assignees
Labels

Comments

@danrademacher
Copy link
Member

  • Can the user cancel processing of a file in progress?
  • Show warning if that file is large / will take a long time.
  • Send link to email address when complete?
@danrademacher
Copy link
Member Author

Specifically for @mojodna:

  • canceling Celery tasks
  • kill items from the database

@mojodna
Copy link

mojodna commented Jun 17, 2015

This also leads to the question of which broker to use. Ultimately it's going to be up to whoever ends up setting it up, although I'd recommend using the Redis backend (RabbitMQ is the default, but can be finicky to configure) and explicitly configuring Celery to use JSON (Python Pickle is the default until 3.2 and prevents non-Python code from easily looking at tasks) for task serialization (this makes it a bit easier to wire into unexpected tools and to have greater visibility into what's going on behind the scenes).

Using Redis provides an additional option for tracking task state and results (though there may be good Django integration if it makes sense to store the task state along with the rest of a model): http://docs.celeryproject.org/en/latest/getting-started/first-steps-with-celery.html#keeping-results

Tasks can be canceled in 2 ways (via http://celery.readthedocs.org/en/latest/faq.html#can-i-cancel-the-execution-of-a-task):

# given a result (a future)
>>> result = add.apply_async(args=[2, 2], countdown=120)
>>> result.revoke()
# given a task id
>>> from proj.celery import app
>>> app.control.revoke(task_id)

Killing items from the database is likely Django-specific, though it may tie into task states.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants