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

gatewayd-io / gatewayd-plugin-cache / 22264637218
50%

Build:
DEFAULT BRANCH: main
Ran 21 Feb 2026 09:28PM UTC
Jobs 1
Files 6
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

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

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)

20 of 82 new or added lines in 2 files covered. (24.39%)

5 existing lines in 2 files now uncovered.

268 of 541 relevant lines covered (49.54%)

2.11 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
16
79.14
18.64% plugin/plugin.go
46
0.0
0.0% main.go

Uncovered Existing Lines

Lines Coverage ∆ File
1
79.14
18.64% plugin/plugin.go
4
0.0
0.0% main.go
Jobs
ID Job ID Ran Files Coverage
1 22264637218.1 21 Feb 2026 09:28PM UTC 6
49.54
GitHub Action Run
Source Files on build 22264637218
  • Tree
  • List 6
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 0611dcb4 on github
  • Prev Build on main (#16809397891)
  • Next Build on main (#22284276152)
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