add inotify to container
load old last post from config
This commit is contained in:
11
main.go
11
main.go
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user