-
Notifications
You must be signed in to change notification settings - Fork 41
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
Create archive page asynchronously #1203
Create archive page asynchronously #1203
Conversation
Github won't let me link it, but this should also resolve #959 |
For this to work on the servers, we need to create the os.path.join(get_config('outputs'), "archive_page") directory. |
On the test server: |
@mfixstsci I think this is ready for review. |
With these changes, the json files containing the content of the archive pages are updated after each run of archive_database_update.py, which is done via cron job. |
In addition to creating the new archive_page subdirectory under the outputs directory, we'll also need to run the new script on all of the instruments when we merge this.
|
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.
LGTM @bhilbert4 I am going to rebase the branch and then merge it once the CI is done.
# Read in the json file created by data_containers.create_archived_proposals_context | ||
# and use as the context | ||
output_dir = get_config()['outputs'] | ||
context_file = os.path.join(output_dir, 'archive_page', f'{inst}_archive_context.json') |
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 is slick 👍
Rather than querying the database and constructing the context for an instrument's archive page at the time of the request, do that work asynchronously, and save the results in a json file. Then when there is a request for the page, read in the json file and create the page.