From bc0841c3c0b08c3cc7f17636fa2f153c11994aa9 Mon Sep 17 00:00:00 2001 From: JurajKubrican Date: Mon, 8 Sep 2025 12:38:59 +0200 Subject: [PATCH] improve tracking --- .github/workflows/docker-build-self.yml | 2 +- src/main.go | 2 +- src/tracking/middleware.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-build-self.yml b/.github/workflows/docker-build-self.yml index 4d6db44..bfb7c47 100644 --- a/.github/workflows/docker-build-self.yml +++ b/.github/workflows/docker-build-self.yml @@ -45,7 +45,7 @@ jobs: run: | docker run -d --name temp-$IMAGE_NAME -p $TEST_PORT:54321 $IMAGE_NAME:latest sleep 10 # Wait for the container to start - if curl -f http://localhost:$TEST_PORT/health; then + if curl -f --max-time 10 http://localhost:$TEST_PORT/health; then echo "Health check passed" docker stop temp-$IMAGE_NAME docker rm temp-$IMAGE_NAME diff --git a/src/main.go b/src/main.go index 6bb4792..0b9b5ec 100644 --- a/src/main.go +++ b/src/main.go @@ -103,7 +103,7 @@ func main() { // MY supper tracking e.Use(tracking.EchoWithConfig(tracking.TrackingConfig{ - IgnorePaths: []string{"/tracking", "/metrics", "/css/*", "/js/*", "/boxes/ws"}, + IgnorePaths: []string{"/tracking", "/metrics", "/css/*", "/js/*", "/boxes/ws", "*favicon*"}, IgnoreUserAgents: []string{"*Prometheus*", "*UptimeRobot*"}, })) trackingGroup := e.Group("/tracking") diff --git a/src/tracking/middleware.go b/src/tracking/middleware.go index 6d686ea..632dcd6 100644 --- a/src/tracking/middleware.go +++ b/src/tracking/middleware.go @@ -77,7 +77,7 @@ func BasicTrackingHandler(c echo.Context) error { UniqueVisitors: ts.GetUniqueVisitors(), TodayVisits: ts.GetTodayVisits(), ActiveSessions: ts.GetActiveSessions(), - RecentVisits: ts.GetRecentVisits(20), + RecentVisits: ts.GetRecentVisits(50), TopPages: ts.GetTopPages(5), }