• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tecnickcom / nurago / 29372811709
100%

Build:
DEFAULT BRANCH: main
Ran 14 Jul 2026 10:27PM UTC
Jobs 1
Files 201
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

14 Jul 2026 10:23PM UTC coverage: 100.0%. Remained the same
29372811709

push

github

nicolaasuni
feat(sfcache)!: bounded O(log n) eviction, value-protecting eviction levels, failure-anchored stale windows, and a Config struct

BREAKING CHANGE: New takes a Config value instead of the size and ttl parameters, and the WithStaleIfError option is gone, folded into Config.MaxStale.

Migration is mechanical:
- sfcache.New(fn, 256, 5*time.Minute) -> sfcache.New(fn, sfcache.Config{Size: 256, TTL: 5 * time.Minute})
- sfcache.WithStaleIfError(d) -> sfcache.Config{Size: n, TTL: t, MaxStale: d}

Settings that mention neither K nor V now live in Config, because the type parameters of an option whose argument names neither cannot be inferred at the call site. Options are kept for the settings that do depend on the cache types (WithTTLFunc). dnscache.New and awssecretcache.New are unchanged.

Replace the eviction scan with three deadline-ordered heaps: live values, values a failed refresh revived, and error residue. Eviction previously ranged over the whole keymap on every store at capacity, holding the exclusive write lock, so a large capacity was itself a throughput ceiling. A store now takes the head of a queue instead of searching for a victim: it costs O(log Size), and a store with no victim it may take says so in constant time rather than walking the cache to find that out.

Introduce eviction levels, so a lookup that is merely attempted can never cost the cache a live value. A failed lookup stores nothing and may reclaim only entries that hold nothing worth keeping. A stale revive may also take a value that is itself being served stale, preferring the one no caller has asked for. Only a successful lookup may displace a valid entry, and it takes the one closest to expiring. Previously any store at capacity, including a failing one, evicted the oldest live value.

Move the lookups in flight out of the entry map into their own map, so Config.Size bounds the values held rather than the keys being resolved: a burst of cold keys can no longer evict the working ... (continued)

17131 of 17131 relevant lines covered (100.0%)

14591.08 hits per line

Jobs
ID Job ID Ran Files Coverage
1 29372811709.1 14 Jul 2026 10:27PM UTC 201
100.0
GitHub Action Run
Source Files on build 29372811709
  • Tree
  • List 201
  • Changed 7
  • Source Changed 7
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #29372811709
  • 91e7e895 on github
  • Prev Build on main (#29316991257)
  • Next Build on main (#29375966005)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc