diff --git a/internal/config/config.go b/internal/config/config.go index 656daa2a..db2ef571 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -12,7 +12,6 @@ type Config struct { HTTP HTTP `yaml:"http"` // http server config Database Database `yaml:"database"` // database config FCM FCMConfig `yaml:"fcm"` // firebase cloud messaging config - Tasks Tasks `yaml:"tasks"` // tasks config SSE SSE `yaml:"sse"` // server-sent events config Messages Messages `yaml:"messages"` // messages config Cache Cache `yaml:"cache"` // cache (memory or redis) config @@ -60,10 +59,6 @@ type FCMConfig struct { TimeoutSeconds uint16 `yaml:"timeout_seconds" envconfig:"FCM__TIMEOUT_SECONDS"` // push notification send timeout } -type Tasks struct { - Hashing HashingTask `yaml:"hashing"` // deprecated -} - type HashingTask struct { IntervalSeconds uint16 `yaml:"interval_seconds" envconfig:"TASKS__HASHING__INTERVAL_SECONDS"` // deprecated } @@ -104,11 +99,6 @@ func Default() Config { FCM: FCMConfig{ CredentialsJSON: "", }, - Tasks: Tasks{ - Hashing: HashingTask{ - IntervalSeconds: uint16(15 * 60), - }, - }, SSE: SSE{ KeepAlivePeriodSeconds: 15, }, diff --git a/internal/config/module.go b/internal/config/module.go index 4d17c9bb..c8a42757 100644 --- a/internal/config/module.go +++ b/internal/config/module.go @@ -109,16 +109,12 @@ func Module() fx.Option { }), fx.Provide(func(cfg Config) messages.Config { return messages.Config{ - CacheTTL: time.Duration(cfg.Messages.CacheTTLSeconds) * time.Second, - HashingInterval: time.Duration( - max(cfg.Tasks.Hashing.IntervalSeconds, cfg.Messages.HashingIntervalSeconds), - ) * time.Second, + CacheTTL: time.Duration(cfg.Messages.CacheTTLSeconds) * time.Second, + HashingInterval: time.Duration(cfg.Messages.HashingIntervalSeconds) * time.Second, } }), fx.Provide(func(_ Config) devices.Config { - return devices.Config{ - UnusedLifetime: 365 * 24 * time.Hour, //TODO: make it configurable - } + return devices.Config{} }), fx.Provide(func(cfg Config) sse.Config { return sse.NewConfig( diff --git a/internal/sms-gateway/modules/devices/config.go b/internal/sms-gateway/modules/devices/config.go index 7495b3ea..2c61a0c6 100644 --- a/internal/sms-gateway/modules/devices/config.go +++ b/internal/sms-gateway/modules/devices/config.go @@ -1,7 +1,4 @@ package devices -import "time" - type Config struct { - UnusedLifetime time.Duration }