Removed the uneeded i variable in main
Was originally used since the for loop doesn't have a dowhile, but breaking when not false made the code simpler to understandstable
parent
6715716701
commit
01584ea27a
|
|
@ -36,7 +36,6 @@ func main() {
|
||||||
tmpdir := ""
|
tmpdir := ""
|
||||||
hostsloc := ""
|
hostsloc := ""
|
||||||
cfgloc := ""
|
cfgloc := ""
|
||||||
i := true
|
|
||||||
var daemon bool=false
|
var daemon bool=false
|
||||||
var interval int=1440
|
var interval int=1440
|
||||||
|
|
||||||
|
|
@ -49,9 +48,8 @@ func main() {
|
||||||
|
|
||||||
sysdetect (&tmpdir, &hostsloc, &cfgloc)
|
sysdetect (&tmpdir, &hostsloc, &cfgloc)
|
||||||
|
|
||||||
for i == true {
|
for true {
|
||||||
err := error(nil)
|
err := error(nil)
|
||||||
i = daemon
|
|
||||||
sites, downloads, err := cfgparse(cfgloc)
|
sites, downloads, err := cfgparse(cfgloc)
|
||||||
if (err != nil){
|
if (err != nil){
|
||||||
log.Print("Failed to parse config file")
|
log.Print("Failed to parse config file")
|
||||||
|
|
@ -79,8 +77,10 @@ func main() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
log.Print("Finished updating host")
|
log.Print("Finished updating host")
|
||||||
if (i == true){
|
if (daemon == true){
|
||||||
time.Sleep(time.Duration(interval) * time.Minute)
|
time.Sleep(time.Duration(interval) * time.Minute)
|
||||||
|
}else{
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue