Skip to content

Commit 6448e55

Browse files
committed
[config] remove deprecated fields
1 parent 51e5955 commit 6448e55

File tree

3 files changed

+3
-20
lines changed

3 files changed

+3
-20
lines changed

internal/config/config.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ type Config struct {
1212
HTTP HTTP `yaml:"http"` // http server config
1313
Database Database `yaml:"database"` // database config
1414
FCM FCMConfig `yaml:"fcm"` // firebase cloud messaging config
15-
Tasks Tasks `yaml:"tasks"` // tasks config
1615
SSE SSE `yaml:"sse"` // server-sent events config
1716
Messages Messages `yaml:"messages"` // messages config
1817
Cache Cache `yaml:"cache"` // cache (memory or redis) config
@@ -60,10 +59,6 @@ type FCMConfig struct {
6059
TimeoutSeconds uint16 `yaml:"timeout_seconds" envconfig:"FCM__TIMEOUT_SECONDS"` // push notification send timeout
6160
}
6261

63-
type Tasks struct {
64-
Hashing HashingTask `yaml:"hashing"` // deprecated
65-
}
66-
6762
type HashingTask struct {
6863
IntervalSeconds uint16 `yaml:"interval_seconds" envconfig:"TASKS__HASHING__INTERVAL_SECONDS"` // deprecated
6964
}
@@ -104,11 +99,6 @@ func Default() Config {
10499
FCM: FCMConfig{
105100
CredentialsJSON: "",
106101
},
107-
Tasks: Tasks{
108-
Hashing: HashingTask{
109-
IntervalSeconds: uint16(15 * 60),
110-
},
111-
},
112102
SSE: SSE{
113103
KeepAlivePeriodSeconds: 15,
114104
},

internal/config/module.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,12 @@ func Module() fx.Option {
109109
}),
110110
fx.Provide(func(cfg Config) messages.Config {
111111
return messages.Config{
112-
CacheTTL: time.Duration(cfg.Messages.CacheTTLSeconds) * time.Second,
113-
HashingInterval: time.Duration(
114-
max(cfg.Tasks.Hashing.IntervalSeconds, cfg.Messages.HashingIntervalSeconds),
115-
) * time.Second,
112+
CacheTTL: time.Duration(cfg.Messages.CacheTTLSeconds) * time.Second,
113+
HashingInterval: time.Duration(cfg.Messages.HashingIntervalSeconds) * time.Second,
116114
}
117115
}),
118116
fx.Provide(func(_ Config) devices.Config {
119-
return devices.Config{
120-
UnusedLifetime: 365 * 24 * time.Hour, //TODO: make it configurable
121-
}
117+
return devices.Config{}
122118
}),
123119
fx.Provide(func(cfg Config) sse.Config {
124120
return sse.NewConfig(
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
package devices
22

3-
import "time"
4-
53
type Config struct {
6-
UnusedLifetime time.Duration
74
}

0 commit comments

Comments
 (0)