Skip to content

Handle multiple write-enabled haystack routers #33

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

Merged
merged 1 commit into from
Dec 1, 2014

Conversation

stephenmcd
Copy link
Contributor

It's possible for a project to have multiple HAYSTACK_ROUTERS set up that will handle writes to different search backends:

http://django-haystack.readthedocs.org/en/latest/settings.html#haystack-routers

Currently in celery-haystack, the signal handler returns after finding the first writable backend, which this commit fixes.

You can also see here in haystack's default signal handler that the behaviour is different - it doesn't return after finding the first writable backend:

https://github.com/toastdriven/django-haystack/blob/f80cb9f92db1bf080ea5c1bc7e7bff34b1b8ce72/haystack/signals.py#L38-L51

I'm not sure if the early return in celery-haystack is masking another bug where the same task was being enqueued multiple times, or if it was just a minor optimisation - hopefully the latter, but if the former, then this one-line fix is probably insufficient.

Thanks!

jezdez added a commit that referenced this pull request Dec 1, 2014
Handle multiple write-enabled haystack routers
@jezdez jezdez merged commit af6532a into django-haystack:develop Dec 1, 2014
micahscopes pushed a commit to micahscopes/celery-haystack that referenced this pull request Apr 16, 2019
Handle multiple write-enabled haystack routers
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.

2 participants