From 425cd2a9ba2f9b3b0734477e573f8c319da4021b Mon Sep 17 00:00:00 2001 From: mr Date: Thu, 5 Feb 2026 14:10:48 +0100 Subject: [PATCH] NATS_SERVER --- tools/nats_caller.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/nats_caller.go b/tools/nats_caller.go index ffa4f2d..2e477c9 100644 --- a/tools/nats_caller.go +++ b/tools/nats_caller.go @@ -2,6 +2,7 @@ package tools import ( "encoding/json" + "fmt" "strings" "sync" "time" @@ -103,12 +104,14 @@ func (o *natsCaller) SetNATSPub(method NATSMethod, data NATSResponse) string { for { nc, err := nats.Connect(config.GetConfig().NATSUrl) if err != nil { + fmt.Println("NATS Connect err", err) time.Sleep(1 * time.Minute) continue } defer nc.Close() js, err := json.Marshal(data) if err != nil { + fmt.Println("NATS Marshal err", err) return " -> " + err.Error() } err = nc.Publish(method.GenerateKey(), js) // Publish the message on the NATS server with a channel name based on the data name (or whatever start) and the method