From 043247018f48f00e32eec9ef9327655ab9e6d3c8 Mon Sep 17 00:00:00 2001 From: maze Date: Mon, 23 Feb 2026 09:09:10 +0100 Subject: [PATCH] Retab --- .gitea/workflows/dev.yaml | 6 ++++-- collector.go | 12 ++++++------ sql.go | 6 +++--- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/dev.yaml b/.gitea/workflows/dev.yaml index 91e838d..10801aa 100644 --- a/.gitea/workflows/dev.yaml +++ b/.gitea/workflows/dev.yaml @@ -42,11 +42,13 @@ jobs: run: go build -o build/ -v ./cmd/hamview-receiver - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Show env + run: env - name: Log into Container Registry uses: docker/login-action@v3 with: - registry: ${{ env.REGISTRY }} - username: ${{ env.DEPLOY_USER }} + registry: ${{ vars.REGISTRY }} + username: ${{ vars.DEPLOY_USER }} password: ${{ secrets.DEPLOY_TOKEN }} - name: Build and push collector container uses: docker/build-push-action@v6 diff --git a/collector.go b/collector.go index 955d1fa..f497654 100644 --- a/collector.go +++ b/collector.go @@ -335,18 +335,18 @@ func (c *Collector) processMeshCorePacket(packet *protocol.Packet) { last_advert_id ) VALUES ( $1, - $2, - $3, - $4, - $5, + $2, + $3, + $4, + $5, $6, $7, $8, $9 - ) + ) ON CONFLICT (public_key) DO UPDATE - SET + SET name = $3, local_time = $4, last_heard = $6, diff --git a/sql.go b/sql.go index d6bd126..342fe38 100644 --- a/sql.go +++ b/sql.go @@ -184,7 +184,7 @@ const ( received_at DESC; ` sqlSelectMeshCorePacketsByRepeaterWindowed = ` - SELECT + SELECT to_timestamp(round(EXTRACT(EPOCH FROM received_at) / $1) * $1) as window, cast(to_hex(get_byte(path, length(path)-2)) as text) AS repeater, count(id) AS packets @@ -193,8 +193,8 @@ const ( WHERE length(path) >= 2 AND received_at >= $2 - GROUP BY - round(EXTRACT(EPOCH FROM received_at) / $1), + GROUP BY + round(EXTRACT(EPOCH FROM received_at) / $1), cast(to_hex(get_byte(path, length(path)-2)) as text); ` sqlSelectMeshCorePacketPathNodes = `