PolicyStat / jobtastic

Make your user-responsive long-running Celery jobs totally awesomer.
http://policystat.github.com/jobtastic/
MIT License
644 stars 61 forks source link

Protect users against passing Django QuerySets as kwargs to tasks #1

Open winhamwr opened 12 years ago

winhamwr commented 12 years ago

If you pass a Django QuerySet or a Django Model as an argument to a task, very bad things happen. They get pickled as a huge object that takes a lot of Memory, which balloons the amount of RAM taken by the broker, balloons the amount of RAM used by the worker and also manages to make running the task very slow.

If django exists in the jobtastic environment, assert that all of the kwargs aren't instances of a QuerySet or Model.

Also add a setting to disable this behavior, in case someone wants to optimize away the small amount of overhead this might entail.

kylegibson commented 11 years ago

Another idea would be to have a jobtastic setting that is a list of classes to prohibit.