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

refresh_data should be called better #234

Open
odscjames opened this issue Feb 24, 2021 · 0 comments
Open

refresh_data should be called better #234

odscjames opened this issue Feb 24, 2021 · 0 comments

Comments

@odscjames
Copy link
Contributor

I think, currently this app has a function refresh_data - https://github.com/OpenDataServices/org-ids/blob/live/prefix_finder/frontend/views.py#L178

This gets the latest data from the source.

Therefore, it should be called regularly to make sure we get the latest data, and in a sensible way.

Currently it is called from a line in views.py - https://github.com/OpenDataServices/org-ids/blob/live/prefix_finder/frontend/views.py#L178

This means when a new server process for this app is created, it's called then. Actually no - when a new server process is created the first time it gets a request it loads the views file THEN gets the latest data (tested this in UWSGI logs).

Shouldn't this be run from a command, with a cron job updating regularly?

Note this function is also called by calls to URLS ^_preview_branch/([A-Za-z0-9-]+ - some way of allowing people to preview different branches should be provided - maybe remove the URL and add a parameter to the command?

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

No branches or pull requests

1 participant