initialize state package in main.go
This commit adds config values to the config package for state configuration. This commit also adds a call to state.Init() to the main function. Signed-off-by: Ava Affine <ava@sunnypup.io>
This commit is contained in:
parent
0a29b35f4b
commit
9d3ca54ad4
2 changed files with 16 additions and 0 deletions
|
|
@ -33,6 +33,12 @@ type AppConfig struct {
|
|||
current recommended value is 1000ms.
|
||||
*/
|
||||
VoiceActivityTimerSleepIntervalMillis int `yaml:"voice_activity_timer_sleep_interval_millis"`
|
||||
|
||||
/* persistent state file store */
|
||||
PersistentCacheStore string `yaml:"persistent_cache_store"`
|
||||
|
||||
/* number of internal state events to cache in memory */
|
||||
InMemoryEventCacheSize int `yaml:"InMemoryEventCacheSize"`
|
||||
}
|
||||
|
||||
var config *AppConfig
|
||||
|
|
@ -87,4 +93,6 @@ func setDefaults() {
|
|||
viper.SetDefault("LogAddSource", true)
|
||||
viper.SetDefault("VoiceActivityThresholdSeconds", 600)
|
||||
viper.SetDefault("VoiceActivityTimerSleepIntervalMillis", 1000)
|
||||
viper.SetDefault("PersistentCacheStore", "/tmp/bingobot")
|
||||
viper.SetDefault("InMemoryEventCacheSize", 512)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue