-
Notifications
You must be signed in to change notification settings - Fork 7
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
Save source graphic in monarch-link-app and clear unused entries periodically #927
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 fine, although minor question on something that isn't a change. Also, is there a reason why you have the cron logs going to a separate file rather than stdout? This just seems like a way to have the image size increase over time and make it harder to spot errors.
@@ -161,9 +175,12 @@ def display(id): | |||
try: | |||
response = Response() | |||
response.mimetype = "application/json" | |||
response.set_data(json.dumps({"renderings": [ | |||
response_val = {"renderings": [ |
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.
Non-blocking, but is there a reason to have this renderings array that will always be one element?
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.
It just makes the schema consistent with what is expected from the tactile-svg handlers on the client end.
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 had forgotten to remove the redirection to the separate file! That was for testing convenience.
I've made a new commit to fix that
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 if you've tested the change!
Changes made to the monarch-link-app are as follows:
This PR involves changes required for Shared-Reality-Lab/IMAGE-browser#391 and moving the monarch-link-app to production
Tested with post requests to /create and /update/<id> endpoints with and without "graphicBlob" field:
The resulting display/<id> with "graphicBlob" and without "graphicBlob" were as follows:
i.e. the results were identical except for the presence of graphicBlob in /display/<id> response when it was present in the entry
2. Testing cron job:
Logs from monarch-link-app:
Logs from cron job:
Entry with code 543647 was deleted at 19:00:00 i.e. about an hour after it was created. Entry with code 156528 was deleted at 20:00:00 i.e. roughly an hour after it was last updated although it was created at 18:07:26.
Required Information
Coding/Commit Requirements
New Component Checklist (mandatory for new microservices)
docker-compose.yml
andbuild.yml
..github/workflows
.README.md
file that describes what the component does and what it depends on (other microservices, ML models, etc.).OR