-
Notifications
You must be signed in to change notification settings - Fork 1
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
OpenSearch indexes partitioned to daily partitions #4
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
from django.test.utils import override_settings | ||
|
||
from .models import CommandLog, CeleryTaskRunLog, CeleryTaskInvocationLog, InputRequestLog, OutputRequestLog | ||
from .models import PartitionedLog | ||
|
||
|
||
class store_elasticsearch_log(override_settings): | ||
|
@@ -21,7 +22,11 @@ def enable(self): | |
for document_class in (CommandLog, CeleryTaskRunLog, CeleryTaskInvocationLog, | ||
InputRequestLog, OutputRequestLog): | ||
document_class._index._name = f'{uuid}.{document_class._index._name}' | ||
document_class.init() | ||
if issubclass(document_class, PartitionedLog): | ||
template = document_class.get_template() | ||
template.save() | ||
else: | ||
document_class.init() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't it be better to override the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
def disable(self): | ||
for document_class in (CommandLog, CeleryTaskRunLog, CeleryTaskInvocationLog, | ||
|
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.
why is there another import line instead of an addition to the one above?
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.
line length would be too long
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.
why not use parentheses instead? they are used elsewhere int he project
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.
Ok, but let's incorporate some linting, it's hard to search in project what conventions should be used.