Closed boozook closed 2 years ago
@fzzr- it's strongly suggested that you have an internet connection. DuckPAN downloads metadata and assets from DuckDuckGo relatively often so that everything is in sync.
We could try making that a non-fatal error but I'm not sure how well everything will work.
@moollaza I'm in favor of having some caching for the assets and metadata - with a reset of maybe... 1 hour or so? If we made it clear that this was happening (so people knew to reset the cache if need be) I think it would be fine. Also, I find a lot of dev time in DuckPAN is spent waiting for the downloads - which can be really painful!
Of course if it fails to download new data it could just fallback on the cache (allowing for offline use).
Edit: Hmm... Looks like it should be doing something similar to this already? Doesn't seem to do anything on mine though...
Edit 2: Weird... Sometimes the caching is fine, and it loads reasonably fast, but other times it takes up to a minute...
Edit: Hmm... Looks like it should be doing something similar to this already? Doesn't seem to do anything on mine though...
@fzzr- @GuiltyDolphin currently DuckPAN does cache the assets, but I believe every hour or so it checks to see if the assets have updated. This requires a call to DuckDuckGo to check if the versioned assets on DuckDuckGo.com have changed. I thought 02pacakges.details.txt was also being cached, but I don't recall if it is right now.
The idea behind the caching was that previously every time the server started it would download all the necessary assets which obviously made things slower.
If you run duckpan -v server
you should see it indicate when it's using the cached assets.
If you run duckpan -e -v server
you can force the cache to be cleared, and you should see it download a new copy of all the required assets.
On startup I believe DuckPAN also checks to make sure you're using the newest version of DuckPAN and DDG, this is necessary because changes to the repos may require changes to DDG/DuckPAN and you could run into breakage if they aren't kept in sync.
DuckPAN does have a local .duckpan/config
file. I suppose we could allow users to specify a cache time to allow DuckPAN to skip checking for updates for a longer period of time.
@moollaza I have .duckpan/config directory. It's empty. One question: how to get/export current default config into that dir (~/.duckpan/config/
)?
One question: how to get/export current default config into that dir (~/.duckpan/config/)?
@fzzr- there isn't really a default config
right now. The config dir is just used to house the env.ini file that DuckPAN creates/uses when you use the duckpan keys
command to add/renamed/delete API keys
:) Thanks. I see the key DDG_METADATA_TIMEOUT
and will try use it soon.
@fzzr- You'll probably want to use NO_METADATA_DOWNLOAD
if you're working off master - the DDG_METADATA_TIMEOUT
is only on one of my branches AFAIK.
@GuiltyDolphin, thank you. Currently I use both of them - for case if in the future the NO_METADATA_DOWNLOAD
will be legacy or deprecated (Or you will merge your branch into master).
@fzzr- I'll fight against deprecation of NO_METADATA_DOWNLOAD
:wink:, I have connection issues too.
I don't think my branch will get merged, but if it does then sure, that var will work.
I'd recommend just having export NO_METADATA_DOWNLOAD=1
in your .bashrc
, and hopefully that will have you sorted.
If we ever come back to changing the variable I'll ping you so you are in the loop.
Is it possible to configure Duckpan for offline testing our great goodies & spices? Currently I always get update-error: