Skip to content

Commit

Permalink
Merge pull request #382 from hearchco/as/fix/cache-results
Browse files Browse the repository at this point in the history
fix(config): remove config for results cache that was left behind
  • Loading branch information
aleksasiriski authored Aug 29, 2024
2 parents 195767f + 1d64905 commit 00687da
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/config/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ func New() Config {
Type: "none",
KeyPrefix: "HEARCHCO_",
TTL: TTL{
Results: moretime.Week,
Currencies: moretime.Day,
},
Redis: Redis{
Expand Down
2 changes: 0 additions & 2 deletions src/config/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ func (c Config) getReader() ReaderConfig {
Cache: ReaderCache{
Type: c.Server.Cache.Type,
TTL: ReaderTTL{
Results: moretime.ConvertToFancyTime(c.Server.Cache.TTL.Results),
Currencies: moretime.ConvertToFancyTime(c.Server.Cache.TTL.Currencies),
},
Redis: c.Server.Cache.Redis,
Expand Down Expand Up @@ -163,7 +162,6 @@ func (c *Config) fromReader(rc ReaderConfig) {
Cache: Cache{
Type: rc.Server.Cache.Type,
TTL: TTL{
Results: moretime.ConvertFromFancyTime(rc.Server.Cache.TTL.Results),
Currencies: moretime.ConvertFromFancyTime(rc.Server.Cache.TTL.Currencies),
},
Redis: rc.Server.Cache.Redis,
Expand Down
6 changes: 0 additions & 6 deletions src/config/structs_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,11 @@ type Cache struct {
// Example: 1s, 1m, 1h, 1d, 1w, 1M, 1y.
// If unit is not specified, it is assumed to be milliseconds.
type ReaderTTL struct {
// How long to store the results in cache.
// Setting this to 0 caches the results forever.
Results string `koanf:"time"`
// How long to store the currencies in cache.
// Setting this to 0 caches the currencies forever.
Currencies string `koanf:"currencies"`
}
type TTL struct {
// How long to store the results in cache.
// Setting this to 0 caches the results forever.
Results time.Duration
// How long to store the currencies in cache.
// Setting this to 0 caches the currencies forever.
Currencies time.Duration
Expand Down

0 comments on commit 00687da

Please sign in to comment.