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

gatewayd-io / gatewayd-plugin-cache / 22264637218 / 1
50%
main: 50%

Build:
DEFAULT BRANCH: main
Ran 21 Feb 2026 09:28PM UTC
Files 6
Run time 0s
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

21 Feb 2026 09:24PM UTC coverage: 49.538% (+8.3%) from 41.21%
22264637218.1

push

github

web-flow
Improvements (#87)

* Fix return -> continue in UpdateCache to prevent goroutine death

The UpdateCache goroutine used `return` instead of `continue` on
error paths (empty database, query parse failure, table extraction
failure). A single transient error would permanently kill the
goroutine, stopping all server-response caching for the plugin's
lifetime. Resolves #64.

* Fix IsCacheNeeded to check parsed query instead of cache key

IsCacheNeeded was called with the full cache key (server:db:request_bytes)
instead of the actual SQL query string. Date/time function detection
against raw binary bytes was unreliable. Now the query is parsed first
via GetQueryFromRequest and uppercased before checking.

* Fix ExitOnStartupError ordering and close(nil) panic in main.go

Move config field assignments (including ExitOnStartupError) before
the API client initialization block so the flag is set when first
checked. Also guard the deferred channel close to prevent a panic
when config is nil and the channel was never initialized.

* Add CacheErrorsCounter, fix double-counting misses, and fix typos

Introduce a dedicated CacheErrorsCounter to separate Redis operation
failures from genuine cache misses. Previously CacheMissesCounter was
incremented for SET/DEL/SCAN errors, making the metric unreliable.
Also fix double-counting in OnTrafficFromClient where a single miss
incremented CacheMissesCounter twice. Fix typos: cachedRespnseKey ->
cachedResponseKey, DateFucntion -> DateFunction.

* Extract duplicated startup error handling into helper function

Replace three copies of the ExitOnStartupError check + manual close +
os.Exit(1) pattern with a single handleStartupError helper that
accepts variadic io.Closer resources. Reduces boilerplate and
ensures consistent behavior across all startup error paths.

* Add explicit config validation with sensible defaults

Previously cast.To* silently returned zero-values for invalid config.
Now redisURL, expiry, and scanCount are... (continued)

268 of 541 relevant lines covered (49.54%)

2.11 hits per line

Source Files on job 22264637218.1
  • Tree
  • List 6
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 22264637218
  • 0611dcb4 on github
  • Prev Job for on main (#16809397891.1)
  • Next Job for on main (#22284276152.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc