Explorar o código

print a log message when the nats connection is not available

Tobias von Dewitz %!s(int64=6) %!d(string=hai) anos
pai
achega
6595810e6a
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      main.go

+ 3 - 0
main.go

@@ -353,6 +353,9 @@ func publishRequest(queue string, request *data.Request) {
 	}
 
 	if !natsIsAvailable {
+		if rand.Intn(100) == 0 {
+			log.Println("nats connection is not available")
+		}
 		return
 	}