From f3e3ca0adf7afc797cf2a63f90082b04d4a05765 Mon Sep 17 00:00:00 2001 From: Aamos Pernu Date: Tue, 19 Sep 2023 15:44:20 +0300 Subject: [PATCH 1/2] Fixed ERROR no headers found in message occurring every minute --- Dockerfile | 4 ++-- gosmee/client.go | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0b3bf8b..4eb76b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM --platform=$BUILDPLATFORM golang:latest -COPY . /go/src/github.com/chmouel/gosmee -WORKDIR /go/src/github.com/chmouel/gosmee +COPY . /go/src/github.com/aaamosljp/gosmee +WORKDIR /go/src/github.com/aaamosljp/gosmee ARG TARGETARCH RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -a -ldflags="-s -w" -installsuffix cgo -o /tmp/gosmee . diff --git a/gosmee/client.go b/gosmee/client.go index 4a1ea22..5c9c810 100644 --- a/gosmee/client.go +++ b/gosmee/client.go @@ -289,6 +289,13 @@ func (c goSmee) clientSetup() error { return } + if string(msg.Event) == "ping" { + return + } /* Apparently github sends + * a ping every minute but it's not + * documented anywhere for some reason + */ + pm, err := c.parse(now, msg.Data) if err != nil { fmt.Fprintf(os.Stdout, From 26a15502c6329e68c4804474f596bbd6d6f0add9 Mon Sep 17 00:00:00 2001 From: aamosljp Date: Wed, 20 Sep 2023 16:03:49 +0300 Subject: [PATCH 2/2] Update Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4eb76b3..0b3bf8b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM --platform=$BUILDPLATFORM golang:latest -COPY . /go/src/github.com/aaamosljp/gosmee -WORKDIR /go/src/github.com/aaamosljp/gosmee +COPY . /go/src/github.com/chmouel/gosmee +WORKDIR /go/src/github.com/chmouel/gosmee ARG TARGETARCH RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -a -ldflags="-s -w" -installsuffix cgo -o /tmp/gosmee .