1. Jason Moiron
  2. johnny-cache
  3. Issues
Issue #47 resolved

celery task wrapping another way

Greg Taylor
created an issue

Is the attached module a better way to do celery task wrapping than the task_wrapper in utils.py? I don't have to explicitly change all of my celery task calls, since there are signals that django-celery sends.

I'm not entirely sure how johnny_task_wrapper() is supposed to work, since it's not documented. Though, if I understand, I'd have to wrap all of my Task calls with it. Might this be better done via signals for most cases?

Comments (5)

  1. Anonymous

    Hi Greg, Yes, your tasks.py is probably more straightforward for a typical installation than wrapping every celery task. Personally I would probably rather do

    from johnny.cache import get_backend, local

    get_backend().patch() #instead of QueryCacheMiddleware

    local.clear() #instead of LocalStoreClearMiddleware

  2. Log in to comment