RamenDR / ramen

Apache License 2.0
70 stars 51 forks source link

Timed based addon cache #1389

Closed nirs closed 3 weeks ago

nirs commented 2 months ago

Improve the caching logic to refresh the cache automatically base on cached item age. This ensures that we always use fresh cache (< 2 days), so new changes in addons resources are used automatically and transparently for developers and CI.

The time based logic also avoids the issue of having to clear the cache to trigger a refresh of the cache, eliminating refreshes during builds. We can run now drenv cache envfile from a daily cron job, to update the cached resources every day.

The time based logic also allows retries on drenv cache errors. We can run a simple retry loop running drenv cache every 5 minutes until it succeeds. Cached items newer than 12 hours are skipped automatically.

Fixes #1435