Open mico opened 2 years ago
Also, maybe it's a good idea to save a file to the cache e.g. ~/.cache/nist-pubid/nist-tech-pubs.xml
and update it (once per day?) after report displayed
Could use something like this https://github.com/DannyBen/webcache ?
@ronaldtse For now I just added the message "Downloading NIST-Tech-Pubs XML database...". Will it be enough for now? Should I work on caching?
@mico the "down" gem is actually pretty good at showing progress: https://github.com/janko/down
Yes I think we need to provide caching. Maybe you can use the path ~/.metanorma/cache/nist-pubid/nist-tech-pubs.xml
.
I don't know how to integrate webcache
functionality with down
though, it might be possible.
In addition, I think adding some more messages around the download task is useful:
I just found https://raw.githubusercontent.com/usnistgov/NIST-Tech-Pubs/nist-pages/xml/allrecords.xml 52Mb It takes around 15 seconds to complete download on 50Mbps internet. But with slower internet could take minutes, so the user could think "report" command is just broken. Tried to find compressed version to download but didn't find any.