Fix grpcserver rate limiter: move to Server field
The package-level defaultRateLimiter drained its token bucket across all test cases, causing later tests to hit ResourceExhausted. Move rateLimiter from a package-level var to a *grpcRateLimiter field on Server; New() allocates a fresh instance (10 req/s, burst 10) per server. Each test's newTestEnv() constructs its own Server, so tests no longer share limiter state. Production behaviour is unchanged: a single Server is constructed at startup and lives for the process lifetime.
This commit is contained in:
13
web/embed.go
Normal file
13
web/embed.go
Normal file
@@ -0,0 +1,13 @@
|
||||
// Package web provides embedded filesystem access to the web UI assets
|
||||
// (HTML templates and static files). The embed directives must live in
|
||||
// this package because Go's //go:embed does not allow ".." path components;
|
||||
// internal/ui imports these variables instead.
|
||||
package web
|
||||
|
||||
import "embed"
|
||||
|
||||
//go:embed all:templates
|
||||
var TemplateFS embed.FS
|
||||
|
||||
//go:embed all:static
|
||||
var StaticFS embed.FS
|
||||
Reference in New Issue
Block a user