add inotify to container

load old last post from config
This commit is contained in:
2020-01-16 12:31:29 +01:00
parent 79abcb72fb
commit 4aa8b0bcec
2 changed files with 7 additions and 7 deletions

11
main.go
View File

@@ -20,11 +20,12 @@ import (
func init() {
viper.SetDefault("development_mode", true)
viper.SetDefault("cronjob_interval", "@every 5m")
viper.SetDefault("lastPostTimestamp", "2000-01-01T00:00:00Z")
viper.SetConfigType("yaml")
viper.SetConfigName("config") // name of config file (without extension)
viper.AddConfigPath("/etc/fbBot/") // path to look for the config file in
viper.AddConfigPath("$HOME/.fbBot") // call multiple times to add many search paths
viper.AddConfigPath(".") // optionally look for config in the working directory
viper.SetConfigName("config") // name of config file (without extension)
viper.AddConfigPath("/etc/fbBot/") // path to look for the config file in
//viper.AddConfigPath("$HOME/.fbBot") // call multiple times to add many search paths
//viper.AddConfigPath(".") // optionally look for config in the working directory
if err := viper.ReadInConfig(); err != nil {
if _, ok := err.(viper.ConfigFileNotFoundError); ok {
// any approach to require this configuration into your program.
@@ -72,7 +73,7 @@ login:
return innerHTML
},
})
lastUpdatePosted = viper.GetString("lastPostTimestamp")
}
func main() {