Improve caching, move mutex to the cache implementation

This commit is contained in:
2023-08-24 23:53:52 +03:00
parent 49c962e13c
commit acb9f97806
4 changed files with 42 additions and 28 deletions

View File

@@ -20,7 +20,7 @@ func NewApplication(ctx context.Context, cfg Config, logger *zap.Logger) (*Appli
return nil, fmt.Errorf("new db: %w", err)
}
cache := make(inmemorycache.Cache)
cache := inmemorycache.NewCache()
repo, err := repository.NewConnLogs(ctx, db, cache, logger, cfg.UpdateInterval)
if err != nil {