sainw 3 rokov pred
rodič
commit
f5a580f7a9
2 zmenil súbory, kde vykonal 6 pridanie a 3 odobranie
  1. 4 1
      client/listener.go
  2. 2 2
      example/main.go

+ 4 - 1
client/listener.go

@@ -22,7 +22,10 @@ func listen(c *FhoClient, object string, lastUpdatedTime time.Time, fn func(*[]m
 			log.Println("Error:", err.Error())
 			break
 		}
-		return fn(data)
+		err = fn(data)
+		if err != nil {
+			return err
+		}
 	}
 	return nil
 }

+ 2 - 2
example/main.go

@@ -17,9 +17,9 @@ func main() {
 	if err != nil {
 		panic(err)
 	}
-	// go listenProducts(client)
+	go listenProducts(client)
 	// go listenPrices(client)
-	go query(client)
+	// go query(client)
 	// update(client)
 	// updateFromFHO(client)