remove init for failed posts cache

This commit is contained in:
ionutboangiu
2025-11-12 18:11:47 +02:00
committed by Dan Christian Bogos
parent e0f2f3c937
commit 4714fb783b
2 changed files with 3 additions and 7 deletions

View File

@@ -36,12 +36,8 @@ import (
var failedPostCache *ltcache.Cache
func init() {
failedPostCache = ltcache.NewCache(-1, 5*time.Second, true, false, []func(itmID string, value any){writeFailedPosts})
}
// SetFailedPostCacheTTL recreates the failed cache
func SetFailedPostCacheTTL(ttl time.Duration, static bool) {
// InitFailedPostCache initializes the failed posts cache.
func InitFailedPostCache(ttl time.Duration, static bool) {
failedPostCache = ltcache.NewCache(-1, ttl, static, false, []func(itmID string, value any){writeFailedPosts})
}

View File

@@ -59,7 +59,7 @@ func (s *LoggerService) Start(_ *utils.SyncedChan, registry *servmanager.Service
}
cm := cms.(*ConnManagerService).ConnManager()
utils.Logger = engine.NewExportLogger(context.TODO(), s.cfg.GeneralCfg().DefaultTenant, cm, s.cfg)
efs.SetFailedPostCacheTTL(s.cfg.EFsCfg().FailedPostsTTL, s.cfg.EFsCfg().FailedPostsStaticTTL)
efs.InitFailedPostCache(s.cfg.EFsCfg().FailedPostsTTL, s.cfg.EFsCfg().FailedPostsStaticTTL)
return nil
}