Commit f32e2e1c authored by Erick Hitter's avatar Erick Hitter
Browse files

Organization cleanup to match 4b576c23

parent 4b576c23
......@@ -84,25 +84,6 @@ func spawnEventRetrievers(sites <-chan Site, queue chan<- Event) {
logger.Println("Event-retrieval workers spawned")
}
func retrieveSitesPeriodically(sites chan<- Site) {
for true {
logger.Println("Retrieving sites")
siteList, err := getSites()
if err != nil {
time.Sleep(getEventsLoop)
continue
}
for _, site := range siteList {
sites <- site
}
logger.Printf("Sites sent to event retrievers, next site retreival in %d seconds", getEventsLoop / 1000 / 1000 / 1000)
time.Sleep(getEventsLoop)
}
}
func spawnEventWorkers(queue <-chan Event) {
logger.Println("Spawning event workers")
......@@ -122,6 +103,25 @@ func spawnEventWorkers(queue <-chan Event) {
os.Exit(1)
}
func retrieveSitesPeriodically(sites chan<- Site) {
for true {
logger.Println("Retrieving sites")
siteList, err := getSites()
if err != nil {
time.Sleep(getEventsLoop)
continue
}
for _, site := range siteList {
sites <- site
}
logger.Printf("Sites sent to event retrievers, next site retreival in %d seconds", getEventsLoop / 1000 / 1000 / 1000)
time.Sleep(getEventsLoop)
}
}
func keepAlive() {
time.Sleep(getEventsLoop)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment