Code Monkey home page Code Monkey logo

django-celery-fulldbresult's People

Contributors

alexandrearpin avatar bartdag avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-celery-fulldbresult's Issues

Fix PeriodicTask customization

Move our own customization to django-celery-fulldbresult. Django-celery has very limited default and a questionable list_display order (a boolean flag as the entry link).

OperationalError: (1071, 'Specified key was too long; max key length is 767 bytes')

When running migration, with Django 2.0 got this traceback

venv/lib64/python3.6/site-packages/MySQLdb/connections.py", line 292, in query
mysql.connection.query(self, query)
django.db.utils.OperationalError: (1071, 'Specified key was too long; max key length is 767 bytes')
Applying django_celery_fulldbresult.0001_initial...

Django==2.0
celery==3.1.25
django-celery==3.2.2
django-celery-fulldbresult==0.5.3

Monkeypatched Task.apply_async getting TaskType instead of Task argument

Here's a problem I've noticed only with the latest version of django-celery-fulldbresult.

Description of problem

After setting up the fulldbresult backend with an existing Celery and django-celery installation, I saw this error from the Celery beat worker:

SchedulingError: Couldn't apply scheduled task Send queued mail: unbound method apply_async() must be called with Task instance as first argument (got TaskType instance instead)

The particular task had been run previously as set up as a djcelery PeriodicTask in the admin.

Environment

The worker is executed with the ./manage.py celery beat command.

Package versions:

django: 1.9.7
celery: 3.1.23
django-celery: 3.1.17
django-celery-fulldbresult: 0.5.0

_Everything works fine if I drop down to the previous version of django-celery-fulldbersult, 0.4.1.

My analysis

I added IPython.embed into the new_apply_async function used to monkeypatch Task.apply_async (as the first line in the function) and discovered that self is a celery.app.TaskType instance, not a celery.app.Task instance.

Here's the session output (with a few names updated):

In [1]: type(self)
Out[1]: [2016-08-29 17:21:20,401: WARNING/MainProcess] celery.app.task.TaskType
In [2]: self??
[2016-08-29 17:21:22,875: WARNING/MainProcess] Init signature: self(name, *args, **kwargs)
Source:
@task(name="run_management_command")
def run_management_command(name, *args, **kwargs):
    call_command(name, *args, **kwargs)
File:           ~/Projects/myproject/app/tasks.py
Type:           TaskType

That's the full task definition but Python sees a TaskType not a Task instance. I can't quite put my finger on why this is happening, but I do wonder if it has to do with how the monkeypatch is applied. Of course if no one else is experiencing this then not sure how that'd be the case.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.