func main() { lines := selectdb.SelectLines() for _, line_id := range lines { go func(line string) { logger.GetLogger().Info("Started monitoring line %v", line) livemonitoring.MonitorLine(line) }(line_id) } select {} }
func main() { lines := selectdb.SelectLines() linesToMonitor := make(map[string]bool) for _, line := range lines { linesToMonitor[line] = true } logger.GetLogger().Info("Started monitoring lines: %v", lines) livemonitoring.MonitorStops(linesToMonitor) }
func main() { lines := selectdb.SelectLines() ch := make(chan string) for _, line_id := range lines { go func(line string) { updatedb.UpdateAdjacentStops(line) ch <- line }(line_id) } for i := 0; i < len(lines); i++ { logger.GetLogger().Info("Done for line %v", <-ch) } logger.GetLogger().Info("Adjacent stops for all lines updated") }
func getExistingLines() mapset.Set { return setutil.NewSetFromSlice(selectdb.SelectLines()) }