From 1a2e961f98e95cc61dd757e20b187b813c7cd28e Mon Sep 17 00:00:00 2001 From: Ramez Magdy Date: Thu, 30 Sep 2021 18:11:53 +0200 Subject: [PATCH] fixes #1019 this commit fixes #1019 --- builtin/bins/dkron-executor-nats/nats.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/builtin/bins/dkron-executor-nats/nats.go b/builtin/bins/dkron-executor-nats/nats.go index e918a0216..844f5eadd 100644 --- a/builtin/bins/dkron-executor-nats/nats.go +++ b/builtin/bins/dkron-executor-nats/nats.go @@ -73,6 +73,11 @@ func (s *Nats) ExecuteImpl(args *dktypes.ExecuteRequest) ([]byte, error) { if debug { log.Printf("request %#v\n\n", nc) } + + if nc.IsConnected() { + defer nc.Flush() + defer nc.Close() + } return output.Bytes(), nil }