Update STOMP disconnection

This commit is contained in:
Fred Boniface
2024-04-15 20:36:33 +01:00
parent ba8e4e4c72
commit 790d293bc4
4 changed files with 18 additions and 9 deletions

View File

@@ -39,7 +39,6 @@ func processCifData(s *upstreamApi.JsonScheduleV1) error {
}
return nil
} else {
err := fmt.Errorf("unknown transaction type: %s", s.TransactionType)
return err
return fmt.Errorf("unknown transaction type: %s", s.TransactionType)
}
}

View File

@@ -1,6 +1,8 @@
package vstp
import (
"time"
"git.fjla.uk/owlboard/timetable-mgr/log"
"github.com/go-stomp/stomp/v3"
"go.uber.org/zap"
@@ -9,6 +11,7 @@ import (
var count uint64 = 0
func handle(msg *stomp.Message) {
start := time.Now()
count++
log.Info("Message received", zap.Uint64("total since startup", count))
schedule, err := unmarshalData(string(msg.Body))
@@ -19,4 +22,7 @@ func handle(msg *stomp.Message) {
if err != nil {
log.Error("Error processing VSTP Schedule", zap.Error(err))
}
end := time.Now()
duration := start.Sub(end)
log.Info("Message processed", zap.Duration("processing-time", duration))
}