redis included

This commit is contained in:
Max Lerebourg
2022-10-20 02:42:24 +02:00
parent f94e48aa03
commit ffcf4356fc
10 changed files with 767 additions and 558 deletions
+5 -9
View File
@@ -124,15 +124,11 @@ func New(ctx context.Context, next http.Handler, config *Config, name string) (h
if config.RedisCacheEnabled {
cache.InitRedisClient(config.RedisCacheHost, config.RedisCachePassword)
}
if config.CrowdsecMode == streamMode {
go func() {
if ticker == nil {
go handleStreamCache(bouncer)
ticker = startTicker(config, func() {
handleStreamCache(bouncer)
})
}
}()
if config.CrowdsecMode == streamMode && ticker == nil {
ticker = startTicker(config, func() {
handleStreamCache(bouncer)
})
go handleStreamCache(bouncer)
}
return bouncer, nil