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

Rename mapping/es to storage and start using elasticsearch lib #45

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

Conversation

teferi
Copy link
Collaborator

@teferi teferi commented Dec 16, 2016

This commit renames mapping.es.py to storage.py to unify things with
other projects. This also adds initial usage of elasticsearch library
client and expands config to allow old and new code to coexist.

Closes #42
Related #37

This commit renames mapping.es.py to storage.py to unify things with
other projects. This also adds initial usage of elasticsearch library
client and expands config to allow old and new code to coexist.

Closes #42
Related #37
@coveralls
Copy link

Coverage Status

Coverage decreased (-5.7%) to 79.63% when pulling a13cbc6 on use_storage into a9a6a80 on master.

@@ -15,7 +15,8 @@
],
"backend": {
"elastic": "http://4.3.2.1:9200/",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is probably deprecated in favour of "connection", why not remove this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will remove this one in a following commit in the same branch. Right now there is code, that still uses this

logging.error(
"Got {} error when creating index '{}'.".format(
e, index_to_create))
sys.exit(1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this normal to immediately break running flask or gunicorn process here? Why not raise some exception instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function is called from job.py, not from flask

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this code is not planned to be used by wsgi server?

This is actually not a good pattern to terminate python process somewhere deep in code, it is better to raise some exception

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, I tend to agree with you. I'm coping this from it's prev location, but there's no reason not to improve this part =)

logging.error(
"Got {} error when creating index '{}'.".format(
e, index_to_create))
sys.exit(1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this code is not planned to be used by wsgi server?

This is actually not a good pattern to terminate python process somewhere deep in code, it is better to raise some exception

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.

None yet

3 participants