diff --git a/cmd/gotelem/cli/server.go b/cmd/gotelem/cli/server.go index fd7eba2..de2cd1e 100644 --- a/cmd/gotelem/cli/server.go +++ b/cmd/gotelem/cli/server.go @@ -89,7 +89,7 @@ func serve(cCtx *cli.Context) error { slog.SetDefault(logger) - broker := gotelem.NewBroker(3, logger.WithGroup("broker")) + broker := gotelem.NewBroker(20, logger.WithGroup("broker")) // open database dbPath := "file::memory:?cache=shared" diff --git a/cmd/skylabify/skylabify.go b/cmd/skylabify/skylabify.go index bc6fb17..3e0a9c2 100644 --- a/cmd/skylabify/skylabify.go +++ b/cmd/skylabify/skylabify.go @@ -118,12 +118,13 @@ func run(ctx *cli.Context) (err error) { if errors.As(err, &idErr) { // unknown id slog.Info("unknown id", "err", err) + continue } else if err != nil { return err } // format and print out the JSON. - out, _ := json.Marshal(cd) + out, _ := json.Marshal(&cd) fmt.Println(string(out)) } diff --git a/http.go b/http.go index fd9ac7a..281b13c 100644 --- a/http.go +++ b/http.go @@ -123,6 +123,7 @@ func apiV1PacketSubscribe(broker *Broker, db *db.TelemDb) http.HandlerFunc { defer broker.Unsubscribe(conn_id) // attempt to upgrade. c, err := websocket.Accept(w, r, nil) + c.Ping(r.Context()) if err != nil { // TODO: is this the correct option? w.WriteHeader(http.StatusInternalServerError)