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

Fix import to make compatible with celery 5.x. #77

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

debdolph
Copy link

No description provided.

@yeago
Copy link

yeago commented Dec 19, 2020

I tried to implement this branch but got a

  File "/usr/local/lib/python3.6/site-packages/django/dispatch/dispatcher.py", line 175, in <listcomp>
    for receiver in self._live_receivers(sender)
  File "/usr/local/lib/python3.6/site-packages/celery_haystack/signals.py", line 21, in enqueue_save
    return self.enqueue('update', instance, sender, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/celery_haystack/signals.py", line 44, in enqueue
    enqueue_task(action, instance)
  File "/usr/local/lib/python3.6/site-packages/celery_haystack/utils.py", line 47, in enqueue_task
    task_func
  File "/usr/local/lib/python3.6/site-packages/django/db/transaction.py", line 128, in on_commit
    get_connection(using).on_commit(func)
  File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 628, in on_commit
    func()
  File "/usr/local/lib/python3.6/site-packages/celery_haystack/utils.py", line 42, in <lambda>
    task_func = lambda: task.apply_async((action, identifier), kwargs, **options)
  File "/usr/local/lib/python3.6/site-packages/celery/app/task.py", line 559, in apply_async
    link=link, link_error=link_error, **options)
  File "/usr/local/lib/python3.6/site-packages/celery/app/task.py", line 754, in apply
    task = app._tasks[self.name]
  File "/usr/local/lib/python3.6/site-packages/celery/app/registry.py", line 18, in __missing__
    raise self.NotRegistered(key)
celery.exceptions.NotRegistered: None

i suspect celery's internal support for class based tasks has declined. the solution ended up being subclassing the default handler, attaching a name attribute to that, and then pointing to that as the default handler.

update: this library is abandoned and this branch won't work in any reality. ended up architecting around this lib

@Natureshadow
Copy link

This, including the exception mentioned by @yeago, are now fixed in our fork: https://pypi.org/project/celery-haystack-ng/

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

Successfully merging this pull request may close these issues.

3 participants