-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Changing created to modified time #6234
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
Changing created to modified time #6234
Conversation
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.
Looks like a good first approach.
Few changes are required.
readthedocs/search/tasks.py
Outdated
@@ -160,7 +160,7 @@ def record_search_query(project_slug, version_slug, query, total_results, time_s | |||
project__slug=project_slug, | |||
version__slug=version_slug, | |||
created__gte=before_10_sec, |
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.
I think this should also be changed to modified__gte=before_10_sec
.
readthedocs/search/tasks.py
Outdated
@@ -210,5 +210,5 @@ def record_search_query(project_slug, version_slug, query, total_results, time_s | |||
version=version, | |||
query=query, | |||
) | |||
obj.created = time | |||
obj.modified = time |
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.
This line should be removed.
modified
field gets updated automatically.
Also, this can be simplified to
SearchQuery.objects.create(
project=project,
version=version,
query=query,
)
Travis error seems unrelated. |
Same. The testing was successful on my system, that's why I opened the pull request. |
@@ -210,5 +210,3 @@ def record_search_query(project_slug, version_slug, query, total_results, time_s | |||
version=version, | |||
query=query, | |||
) |
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.
We don't need the obj
anymore.
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.
but SearchQuery.objects.create
this thing is needed right?
okay let me update the PR.
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.
but SearchQuery.objects.create this thing is needed right?
yes
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.
Looks good.
Thanks @Iamshankhadeep 🎉 🎉
@dojutsu-user why travis is failing, do you have any Idea? |
@Iamshankhadeep test on travis are fixed on #6233 (after that you should merge master into your branch to run the tests again) |
@stsewd I got it. |
@Iamshankhadeep you can merge master into this branch now |
@dojutsu-user shouldn't this be removed too? readthedocs.org/readthedocs/search/tasks.py Line 169 in 0b657c3
|
This looks ready to be merged. The only thing missing is to delete what @stsewd mentioned in the previous comment. |
I discussed this with @stsewd. Waiting for his review here. |
@Iamshankhadeep yes, you still need to remove that |
Just for clarification, what we discuss with @dojutsu-user is about using the celery-created-time (which probably isn't really important to have that precision vs the complexity of keeping track of the exact time) vs using the real-created-time (current implementation) of the query. In the later case we don't need the |
So if we use real-created-time then we wont be needing |
We can do that in another PR, or just start testing with this change for now |
@stsewd why is it not merged? |
@Iamshankhadeep all good, just waiting for an additional review, but we can just merge it. |
fixes #6155