-
Notifications
You must be signed in to change notification settings - Fork 46
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
Add zopectl.command for reindexing #88
Conversation
@tschorr travis build is broken. Would you mind checking? I would merge the reindex_solr script right away. The _get_site fix would need some more explanation and testing I guess. Maybe it would be better to separate those two issues. BTW: Please update the changelog. |
So first, Travis: The build terminated while trying to download the Solr tarball. This should be unrelated to my changes. I would restart the build, but I am not allowed to do so. |
I re-ran the build. It is green but there is an unreported code violation. We need to fix the travis conf... |
As for the _get_site fix, I'm still googling for where and when the change occured that causes the bug in the original _get_site version. Bottom line, without the fix, none of the entry points will work, and my suggestion would be to leave it in this PR. Also, the fix should be save to use with older versions Zope2/plone.recipe.zope2instance. +1 for more tests, but in this case I'm not yet sure where to start... |
I finally decided to not rely on positional arguments and rather use a flag to pass the site id. It looks like plone.recipe.zope2instance should override Zope.Startup.zopectl.ZopeCmd's run_entrypoint method. This is also the place where tests should be added. |
# name as the first argument and any further arguments after that, but that does not | ||
# work with plone.recipe.zope2instance. Using positional arguments therefore | ||
# is unreliable - resolve to using a flag. | ||
parser = argparse.ArgumentParser() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tschorr if we rely on argparse, don't we have to add it to the dependencies (Python 2.7)?
argparse is part of the Python standard library since the first Python 2.7 release: |
Ok, I guess we have to decide if we drop Python 2.6 support or add it as a dependency. |
Added, with a comment (for easier removal later). |
Add zopectl.command for reindexing
This adds a zopectl.command entry point for reindexing Solr. I needed this because when calling @@solr-maintenance/reindex in the browser, reindexing stopped after ~ 7500 documents, with still ~90000 documents to go. I guess it is the browser that eventually closes the connection.
The PR also fixes a problem in _get_site with recent Zope versions (args has changed).