diff --git a/artifacts/sensu-rri-write_v1.0.2_linux_amd64.tar.gz b/artifacts/sensu-rri-write_v1.0.2_linux_amd64.tar.gz deleted file mode 100644 index e0d5307..0000000 Binary files a/artifacts/sensu-rri-write_v1.0.2_linux_amd64.tar.gz and /dev/null differ diff --git a/artifacts/sensu-rri-write_v1.0.2_sha512_checksums.txt b/artifacts/sensu-rri-write_v1.0.2_sha512_checksums.txt deleted file mode 100644 index ba8d0c3..0000000 --- a/artifacts/sensu-rri-write_v1.0.2_sha512_checksums.txt +++ /dev/null @@ -1 +0,0 @@ -d34facc20617fdfefef6d438f6e33291224a7422ca90dd62b8f2b885ea3213c0859c78b9139a523308eb0d6a786d1fdcae03be142e5d5d87a8edc666a7812d64 sensu-rri-write_v1.0.2_linux_amd64.tar.gz diff --git a/artifacts/sensu-rri-write_v1.0.3_linux_amd64.tar.gz b/artifacts/sensu-rri-write_v1.0.3_linux_amd64.tar.gz new file mode 100644 index 0000000..3318213 Binary files /dev/null and b/artifacts/sensu-rri-write_v1.0.3_linux_amd64.tar.gz differ diff --git a/artifacts/sensu-rri-write_v1.0.3_sha512_checksums.txt b/artifacts/sensu-rri-write_v1.0.3_sha512_checksums.txt new file mode 100644 index 0000000..e0cc9a7 --- /dev/null +++ b/artifacts/sensu-rri-write_v1.0.3_sha512_checksums.txt @@ -0,0 +1 @@ +2f8b7f2fbda2a026539b893db04114353dc5d198095a191fd9b9f2c60657983e75e01548832227b95e81245f743368f0122b6b440eaa0ef3ef3883e46844d7f4 sensu-rri-write_v1.0.3_linux_amd64.tar.gz diff --git a/bin/sensu-rri-write b/bin/sensu-rri-write index 05a9a60..4ffff17 100755 Binary files a/bin/sensu-rri-write and b/bin/sensu-rri-write differ diff --git a/cmd/sensu-rri-write/main.go b/cmd/sensu-rri-write/main.go index 5612fb0..038496c 100644 --- a/cmd/sensu-rri-write/main.go +++ b/cmd/sensu-rri-write/main.go @@ -16,9 +16,14 @@ var ( timeBegin = time.Now() rriClient *rri.Client packrbox = packr.New("box", "../../orderfile") + fails int ) func main() { + run() +} + +func run() { var err error log.SetOutput(os.Stderr) @@ -40,7 +45,6 @@ func main() { if err != nil { printFailMetricsAndExit("login failed:", err.Error()) } - defer rriClient.Logout() // nolint:errcheck timeLoginDone := time.Now() @@ -72,10 +76,17 @@ func main() { "total", durationTotal, timeBegin.Unix()) + rriClient.Logout() // nolint:errcheck + os.Exit(0) } func printFailMetricsAndExit(errors ...string) { + if fails < 3 { + fails++ + run() + } + errStr := "ERROR:" for _, err := range errors { diff --git a/sensu/asset.yaml b/sensu/asset.yaml index 4afbe3e..ebb14ed 100644 --- a/sensu/asset.yaml +++ b/sensu/asset.yaml @@ -3,5 +3,5 @@ api_version: core/v2 metadata: name: sensu-rri-write spec: - sha512: d34facc20617fdfefef6d438f6e33291224a7422ca90dd62b8f2b885ea3213c0859c78b9139a523308eb0d6a786d1fdcae03be142e5d5d87a8edc666a7812d64 - url: https://github.com/DENICeG/sensu-rri-write/releases/download/v1.0.2/sensu-rri-write_v1.0.2_linux_amd64.tar.gz + sha512: 2f8b7f2fbda2a026539b893db04114353dc5d198095a191fd9b9f2c60657983e75e01548832227b95e81245f743368f0122b6b440eaa0ef3ef3883e46844d7f4 + url: https://github.com/DENICeG/sensu-rri-write/releases/download/v1.0.3/sensu-rri-write_v1.0.3_linux_amd64.tar.gz