-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat: c2corg#1067 add public transport information in routes #1797
base: master
Are you sure you want to change the base?
feat: c2corg#1067 add public transport information in routes #1797
Conversation
3dcb75f
to
7198562
Compare
xref #1067 and c2corg/c2c_ui#3936 for frontend |
@@ -282,3 +312,206 @@ def set_title_prefix_for_ids(ids, title): | |||
""" | |||
DBSession.query(RouteLocale).filter(RouteLocale.id.in_(ids)). \ | |||
update({RouteLocale.title_prefix: title}, synchronize_session=False) | |||
|
|||
|
|||
def update_all_pt_rating(waypoint_extrapolation=True): |
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.
a bit worried about using the ORM for such a giant query... best way to run this would be in batches ?
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.
@eddy-geek
The first request runs in 3209.054 ms on my laptop
The whole process is done in a few minutes and is supposed to be used only once, afterwards the informations are supposed to be automaticaly updated on route/waypoint creation/updates
With python log level = INFO and postgresql log level to all, the whole process took about 2-3 hours on my laptop and generates huge amount of logs (since that for each route, every linked waypoints are read and the route updated)
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.
May be the best is to not expose this function to the REST API and run it with a command line ? So only devs can run it
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.
did you run your tests on the full production database?
if it's just a one-time migration then yes we should not leave it in the API, but I guess it's ok to leave it as-is for now and remove the API part after we're done with the initial migration
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 have run the tests on the docker's image data, I don't have access to the production data
The other way to make the migration is to call the function using a python command
7198562
to
51bd9c6
Compare
51bd9c6
to
af19ddd
Compare
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 great.
No description provided.