Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -104,11 +99,6 @@ func Default() Config {
FCM: FCMConfig{
CredentialsJSON: "",
},
Tasks: Tasks{
Hashing: HashingTask{
IntervalSeconds: uint16(15 * 60),
},
},
SSE: SSE{
KeepAlivePeriodSeconds: 15,
},
Expand Down
10 changes: 3 additions & 7 deletions internal/config/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 0 additions & 3 deletions internal/sms-gateway/modules/devices/config.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
package devices

import "time"

type Config struct {
UnusedLifetime time.Duration
}
Loading