poesty пре 9 месеци
родитељ
комит
b787c390ff
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4 1
      rss2hook.go

+ 4 - 1
rss2hook.go

@@ -150,6 +150,7 @@ func main() {
 	config := flag.String("config", "config.json", "The path to the configuration-file to read")
 	config := flag.String("config", "config.json", "The path to the configuration-file to read")
 	timeout := flag.Duration("timeout", 5*time.Second, "The timeout used for fetching the remote feeds")
 	timeout := flag.Duration("timeout", 5*time.Second, "The timeout used for fetching the remote feeds")
 	schedule := flag.String("schedule", "@every 5m", "The cron schedule for fetching the remote feeds")
 	schedule := flag.String("schedule", "@every 5m", "The cron schedule for fetching the remote feeds")
+	startup := flag.Bool("startup", false, "Run on startup (first check)")
 	flag.Parse()
 	flag.Parse()
 
 
 	// Setup the default timeout and TTL
 	// Setup the default timeout and TTL
@@ -187,7 +188,9 @@ func main() {
 				return
 				return
 			}
 			}
 			// TODO: URL validiy checks
 			// TODO: URL validiy checks
-			// feed.Unread = 0
+			if !*startup {
+				feed.Unread = 0
+			}
 			feeds[i] = *feed
 			feeds[i] = *feed
 		}(i, ent)
 		}(i, ent)
 	}
 	}