23 lines
506 B
Go
23 lines
506 B
Go
package vstp
|
|
|
|
import (
|
|
"git.fjla.uk/owlboard/timetable-mgr/log"
|
|
"github.com/go-stomp/stomp/v3"
|
|
"go.uber.org/zap"
|
|
)
|
|
|
|
var count uint64 = 0
|
|
|
|
func handle(msg *stomp.Message) {
|
|
count++
|
|
log.Info("Message received", zap.Uint64("total since startup", count))
|
|
schedule, err := unmarshalData(string(msg.Body))
|
|
if err != nil {
|
|
log.Error("Error unmarshalling VSTP Message", zap.Error(err))
|
|
}
|
|
err = processCifData(schedule)
|
|
if err != nil {
|
|
log.Error("Error processing VSTP Schedule", zap.Error(err))
|
|
}
|
|
}
|