diff --git a/cache/memory/cache.go b/cache/memory/cache.go index 4def49f..2e60fcd 100644 --- a/cache/memory/cache.go +++ b/cache/memory/cache.go @@ -14,11 +14,11 @@ type CacheEntry struct { } type Cache struct { - entries sync.Map - globalTTL time.Duration compressPool sync.Pool decompressPool sync.Pool - sync.RWMutex // Reintroduced to provide lock methods + entries sync.Map + globalTTL time.Duration + sync.RWMutex } func New(globalTTL time.Duration) *Cache { diff --git a/struct_config.go b/struct_config.go index 3a38402..1e8654f 100644 --- a/struct_config.go +++ b/struct_config.go @@ -9,15 +9,6 @@ import ( // config is a struct that holds the configuration of the application. type config struct { - Cache struct { - Client CacheClient - CacheTTL int - CacheEnable bool - CacheRedisEnable bool - CacheRedisURL string - CacheRedisPassword string - CacheRedisDB int - } Logger *libpack_logging.LogConfig Monitoring *libpack_monitoring.MetricsSetup Api struct{ BannedUsersFile string } @@ -35,6 +26,20 @@ type config struct { IntrospectionAllowed []string BlockIntrospection bool } + HasuraEventCleaner struct { + EventMetadataDb string + ClearOlderThan int + Enable bool + } + Cache struct { + Client CacheClient + CacheRedisURL string + CacheRedisPassword string + CacheTTL int + CacheRedisDB int + CacheEnable bool + CacheRedisEnable bool + } Server struct { HostGraphQL string HostGraphQLReadOnly string @@ -49,9 +54,4 @@ type config struct { EnableApi bool PurgeOnCrawl bool } - HasuraEventCleaner struct { - Enable bool - ClearOlderThan int // days to keep - EventMetadataDb string - } }