Browse Source

Изменено логирование количества найденных итемов. Изменена логика открытия конфигурационного файла, теперь, если не задано, то используется файл по-умолчанию.

develop
parent
commit
ef477063d2
  1. 10
      main.go

10
main.go

@ -40,10 +40,11 @@ func main() { @@ -40,10 +40,11 @@ func main() {
log.Println("Flags processed")
if options.ConfigPath == "" {
log.Fatalf("Config path not found in options!")
log.Println("Config path not found in options! Use default from /etc/ssender/config.yml")
} else {
log.Printf("Config from: %s\n", options.ConfigPath)
ConfigPath = options.ConfigPath
}
log.Printf("Config from: %s\n", options.ConfigPath)
ConfigPath = options.ConfigPath
// Get config
cfg, err := config.NewConfig(ConfigPath)
@ -66,11 +67,12 @@ func main() { @@ -66,11 +67,12 @@ func main() {
}
}
//Find new items
// Find new items
sendItems, err := db.FindItems(*rss, cfg.Dbpath)
if err != nil {
log.Fatal(err)
}
log.Printf("Found %d new items to send\n", len(sendItems.ItemList))
if len(sendItems.ItemList) > 0 {
// Run send data depended on configuration options

Loading…
Cancel
Save