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
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:
1 parent
ed3544acfe
commit
01b18be1e4
8 files changed
+400
-109
No files matched your search
+3
-2
@@ -9,6 +9,7 @@ import (
|
||||
"github.com/jackc/pgx/v5"
|
||||
"github.com/jackc/pgx/v5/pgxpool"
|
||||
|
||||
"repos.gfranz.ch/Gabriel20xx/shared/backend/logshipper"
|
||||
sharedpostgres "repos.gfranz.ch/Gabriel20xx/shared/backend/postgres"
|
||||
)
|
||||
|
||||
@@ -314,7 +315,7 @@ func (d *DB) pruneExpiredSessions(ctx context.Context) {
|
||||
return
|
||||
case <-ticker.C:
|
||||
if _, err := d.pool.Exec(ctx, `DELETE FROM auth_sessions WHERE expires_at < now()`); err != nil {
|
||||
fmt.Printf("[db] session prune failed: %v\n", err)
|
||||
logPrintf(logshipper.LevelWarn, "[db] session prune failed: %v\n", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -334,7 +335,7 @@ func (d *DB) cleanupNotifications(ctx context.Context) {
|
||||
case <-ticker.C:
|
||||
cutoff := time.Now().UnixMilli() - retention
|
||||
if _, err := d.pool.Exec(ctx, `DELETE FROM notifications WHERE createdat < $1`, cutoff); err != nil {
|
||||
fmt.Printf("[db] notification cleanup failed: %v\n", err)
|
||||
logPrintf(logshipper.LevelWarn, "[db] notification cleanup failed: %v\n", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user