diff --git a/efs/libefs.go b/efs/libefs.go index bc3a232ae..521b24d24 100644 --- a/efs/libefs.go +++ b/efs/libefs.go @@ -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}) } diff --git a/services/logger.go b/services/logger.go index 037edf06b..05e252c6f 100644 --- a/services/logger.go +++ b/services/logger.go @@ -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 }