diff --git a/src/vstp/handler.go b/src/vstp/handler.go index e3c5ff0..c0e2cd6 100644 --- a/src/vstp/handler.go +++ b/src/vstp/handler.go @@ -1,10 +1,7 @@ package vstp import ( - "encoding/json" "fmt" - "io/ioutil" - "time" //"git.fjla.uk/owlboard/go-types/pkg/database" "git.fjla.uk/owlboard/mq-client/log" @@ -18,24 +15,4 @@ func handle(msg *stomp.Message) { log.Msg.Info("Messages since started: " + fmt.Sprint(count)) schedule := unmarshalData(string(msg.Body)) processEntryType(schedule) - saveToFile(schedule, "transformed") -} - -func saveToFile(msg any, suffix string) { - timestamp := time.Now().Format("2006-01-02T15:04:05") - path := fmt.Sprintf("message-logs/%s-%s.json", timestamp, suffix) - - prettyJSON, err := json.MarshalIndent(msg, "", " ") - if err != nil { - log.Msg.Error("Error marshaling data to JSON: " + err.Error()) - return - } - - err = ioutil.WriteFile(path, prettyJSON, 0644) - if err != nil { - log.Msg.Error("Error saving message: " + err.Error()) - return - } - - log.Msg.Debug("Saved message to: " + path) } diff --git a/src/vstp/parser.go b/src/vstp/parser.go index 20e8c38..81ce73c 100644 --- a/src/vstp/parser.go +++ b/src/vstp/parser.go @@ -28,7 +28,6 @@ func unmarshalData(jsonData string) database.Service { } else if len(schedule.Data.CIFMsg.ScheduleSegment) == 0 { log.Msg.Warn("ScheduleSegment is empty") } - saveToFile(schedule, "unmarshalled") // For Debugging Only return formatData(&schedule.Data.CIFMsg) } diff --git a/src/vstp/subscribe.go b/src/vstp/subscribe.go index e259209..f0de1a4 100644 --- a/src/vstp/subscribe.go +++ b/src/vstp/subscribe.go @@ -30,7 +30,6 @@ func Subscribe() { log.Msg.Error("STOMP Message Error: " + msg.Err.Error()) } else { log.Msg.Info("STOMP Message Received") - saveToFile(string(msg.Body), "msgBody") handle(msg) } }