mirror of
https://github.com/lukaszraczylo/traefikoidc.git
synced 2026-10-13 04:07:37 +00:00
Add sharded cache and prevention of CPU spikes / locks (#96)
* Add sharded cache and prevention of CPU spikes / locks * Add dynamic client registration with oidc provider * Fix race condition introduced during the sharded cache implementation. * Add page for traefikoidc.
This commit is contained in:
+11
-2
@@ -34,6 +34,11 @@ type UniversalCacheConfig struct {
|
||||
Logger *Logger
|
||||
Strategy CacheStrategy // For backward compatibility
|
||||
|
||||
// SkipAutoCleanup skips starting the per-cache cleanup goroutine.
|
||||
// Use this when cleanup is managed externally (e.g., by UniversalCacheManager)
|
||||
// to reduce goroutine count and consolidate cleanup operations.
|
||||
SkipAutoCleanup bool
|
||||
|
||||
// Type-specific configurations
|
||||
TokenConfig *TokenCacheConfig
|
||||
MetadataConfig *MetadataCacheConfig
|
||||
@@ -143,8 +148,12 @@ func createUniversalCache(config UniversalCacheConfig) *UniversalCache {
|
||||
cancel: cancel,
|
||||
}
|
||||
|
||||
// Start cleanup routine
|
||||
cache.startCleanup()
|
||||
// Start cleanup routine only if not skipped
|
||||
// When cleanup is managed externally (e.g., by UniversalCacheManager),
|
||||
// skip per-cache cleanup to reduce goroutine count
|
||||
if !config.SkipAutoCleanup {
|
||||
cache.startCleanup()
|
||||
}
|
||||
|
||||
return cache
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user