Gets the settings, whoopsie on the order of commits

This commit is contained in:
farhan 2020-12-03 17:26:38 -05:00
parent 003de16e2b
commit d474d98f84

View File

@ -21,10 +21,27 @@ func main() {
reportPostChan := make(chan ReportPost) reportPostChan := make(chan ReportPost)
runninginstances = make(map[string]RunningInstance) runninginstances = make(map[string]RunningInstance)
getSettings()
go startpprof() go startpprof()
pool := get_db_pool() pool := get_db_pool()
go startctl(reportPostChan) go startctl(reportPostChan)
for _, endpoint := range settings.Autostart {
log.Print("Autostarting " + endpoint)
ri_mutex.Lock()
_, exists := runninginstances[endpoint]
if exists == true {
log.Println("Already exists: " + endpoint)
} else {
runninginstances[endpoint] = RunningInstance{}
go StartInstance(endpoint, reportPostChan)
}
ri_mutex.Unlock()
}
go webmain(reportPostChan) go webmain(reportPostChan)
for { // Write posts for { // Write posts
v := <-reportPostChan v := <-reportPostChan