IntersectMBO / cardano-db-sync

A component that follows the Cardano chain and stores blocks and transactions in PostgreSQL
Apache License 2.0
283 stars 158 forks source link

Rename Cache type to CacheStatus #1733

Closed Cmdv closed 3 weeks ago

Cmdv commented 3 weeks ago

Description

Found the type names confusing:

data Cache
  = UninitiatedCache
  | Cache !CacheInternal

So renamed it to reflect the fact that it acts like a Maybe:

data CacheStatus
  = NoCache
  | ActiveCache !CacheInternal

Also did this type whilst I was at it:

data CacheNew
  = CacheNew
  | DontCacheNew
  | EvictAndReturn

to

data CacheUpdateAction
  = UpdateCache
  | DoNotUpdateCache
  | EvictAndUpdateCache