Skip to content

Commit

Permalink
feat: respect caching.inter_query_builtin_cache.stale_entry_eviction_…
Browse files Browse the repository at this point in the history
…period_seconds

Signed-off-by: Anthony Regeda <[email protected]>
  • Loading branch information
regeda authored and ashutosh-narkar committed Jan 13, 2025
1 parent 6579186 commit 67240f3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,12 @@ func Validate(m *plugins.Manager, bs []byte) (*Config, error) {
return &cfg, nil
}

// New returns a Plugin that implements the Envoy ext_authz API.
// New returns a Plugin that implements the Envoy ext_authz API with the background context.
func New(m *plugins.Manager, cfg *Config) plugins.Plugin {
return newWithContext(context.Background(), m, cfg)
}

func newWithContext(ctx context.Context, m *plugins.Manager, cfg *Config) plugins.Plugin {
grpcOpts := []grpc.ServerOption{
grpc.MaxRecvMsgSize(cfg.GRPCMaxRecvMsgSize),
grpc.MaxSendMsgSize(cfg.GRPCMaxSendMsgSize),
Expand All @@ -168,7 +172,7 @@ func New(m *plugins.Manager, cfg *Config) plugins.Plugin {
cfg: *cfg,
server: grpc.NewServer(grpcOpts...),
preparedQueryDoOnce: new(sync.Once),
interQueryBuiltinCache: iCache.NewInterQueryCache(m.InterQueryBuiltinCacheConfig()),
interQueryBuiltinCache: iCache.NewInterQueryCacheWithContext(ctx, m.InterQueryBuiltinCacheConfig()),
distributedTracingOpts: distributedTracingOpts,
}

Expand Down

0 comments on commit 67240f3

Please sign in to comment.