implement redis and noop recorders
This commit is contained in:
@@ -91,9 +91,10 @@ func (aw *AmbientWeather) Init() *AmbientWeather {
|
||||
}
|
||||
|
||||
aw.weatherRecorder = recorder.MustNewWeatherRecorder(&recorder.Opts{
|
||||
Ctx: aw.appCtx,
|
||||
KeepLast: updatesToKeep,
|
||||
Recorder: r,
|
||||
AppConfig: aw.Config,
|
||||
Ctx: aw.appCtx,
|
||||
KeepLast: updatesToKeep,
|
||||
Recorder: r,
|
||||
})
|
||||
|
||||
aw.l.Trace().Any("awConfig", aw.Config).Send()
|
||||
|
@@ -9,9 +9,9 @@ const (
|
||||
)
|
||||
|
||||
type RecorderConfig struct {
|
||||
Type RecorderType `yaml:"type" env:"RECORDER_TYPE" json:"type,omitempty"` // memory|redis
|
||||
KeepLast int `yaml:"keepLast" env:"RECORDER_KEEP_LAST" json:"keepLast,omitempty"`
|
||||
RedisConfig *RedisConfig `json:"redisConfig,omitempty"`
|
||||
Type RecorderType `yaml:"type" env:"RECORDER_TYPE" json:"type,omitempty" enum:"memory,redis,noop"`
|
||||
KeepLast int `yaml:"keepLast" env:"RECORDER_KEEP_LAST" json:"keepLast,omitempty" default:"120"`
|
||||
RedisConfig *RedisConfig `yaml:"redisConfig,omitempty" json:"redisConfig,omitempty"`
|
||||
}
|
||||
|
||||
type RedisConfig struct {
|
||||
|
Reference in New Issue
Block a user