-
Couldn't load subscription status.
- Fork 7
Create Biofactoid data downloads 'offline' #1034
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
Conversation
|
- Export on app boot
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.
Some notes
| const MS_PER_SEC = 1000; | ||
| const SEC_PER_MIN = 60; | ||
| const MIN_PER_HOUR = 60; | ||
| const baseUrl = `http://localhost:${PORT}`; // ever not localhost? |
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.
Not really needed anyway, since you could call the corresponding function directly instead of going through the route. It works either way, though going the routes could slow things down.
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.
Makes sense - this requires extracting the logic from the route handlers:
/api/document/and also/api/document/biopax,/api/document/sbgn/api/document/text
I'll try, but if it gets hairy I'll just leave 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.
- Refactoring converter functions
- Stripped out the logic from the endpoints and reused them directly, avoiding the web service routes.
- Fixed up the behaviour on boot:
- When
NODE_ENVisproduction, always create exports - When
NODE_ENVis notproduction(e.g. dev), create the export zips if any are missing (so the web service routes work), otherwise do nothing
- When
… routes work in dev)
|
Looks good to me. Just wondered one thing why there is a delay shift for biopax exports (https://github.com/PathwayCommons/factoid/pull/1034/files#diff-b0e82ba0bf6ce7365597b983e42f14dcca6f038f4297df4c1f811a28f88d035dR190)? Is there a specific reason of why you want to start biopax exports after bulk exports? |
I will get rid of that, probably overthinking things. |
This update attempts to make creating files with Biofactoid data and downloading them more efficient.
/api/document/zipand/api/document/biopax/zipendpoints just serve file(s) that are already createdexportToZipas before to create the required fileEXPORT_BULK_DELAY_HOURS)Refs #1032