feat: ship backend logs to OmniLogger
Lint / Lint (push) Successful in 1m12s
Security / Secrets (gitleaks) (push) Successful in 59s
Security / Dependencies (Trivy) (push) Successful in 49s
Tests / Dashboard checks (push) Successful in 52s
Security / Code (Semgrep) (push) Successful in 1m33s
Tests / Go backend (push) Failing after 1m1s
Docker / Docker Build & Push (push) Failing after 5m16s

This commit is contained in:
Gabriel20xx committed 2026-11-20 21:42:42 +01:00
1 parent ed3544acfe
commit 01b18be1e4
8 files changed
+400 -109

No files matched your search

+4 -3
View File
@@ -3,12 +3,13 @@ package main
import (
"context"
"errors"
"fmt"
"net/http"
"sort"
"time"
"github.com/jackc/pgx/v5"
"repos.gfranz.ch/Gabriel20xx/shared/backend/logshipper"
)
// maxConcurrentSyncs caps sync requests in flight. It stays below the pool size
@@ -431,7 +432,7 @@ func (s *Server) handleSync(w http.ResponseWriter, r *http.Request) {
orphans := make([]OrphanValue, 0)
incoming := len(request.Lists) + len(request.Fields) + len(request.Items) + len(request.ItemValues)
if incoming > 0 {
fmt.Printf("[SYNC] Received lists=%d fields=%d items=%d values=%d\n", len(request.Lists), len(request.Fields), len(request.Items), len(request.ItemValues))
logPrintf(logshipper.LevelInfo, "[SYNC] Received lists=%d fields=%d items=%d values=%d\n", len(request.Lists), len(request.Fields), len(request.Items), len(request.ItemValues))
}
err := s.db.withTx(r.Context(), func(tx pgx.Tx) error {
@@ -447,7 +448,7 @@ func (s *Server) handleSync(w http.ResponseWriter, r *http.Request) {
writeJSONError(w, http.StatusNotFound, "List not found")
return
}
fmt.Printf("[SYNC] Failed: %v\n", err)
logPrintf(logshipper.LevelError, "[SYNC] Failed: %v\n", err)
writeJSONError(w, http.StatusInternalServerError, "Sync failed")
return
}