Fix: fix db migrations and add new row viewed
All checks were successful
CI.yml / build (push) Successful in 1m54s

This commit is contained in:
d3m0k1d
2026-01-13 18:22:15 +03:00
parent 5362761b82
commit 0421d9ef40
4 changed files with 14 additions and 16 deletions

View File

@@ -21,19 +21,13 @@ func Write(db *DB, resultCh <-chan *LogEntry) {
method = *result.Method
}
reason := ""
if result.Reason != nil {
reason = *result.Reason
}
_, err := db.db.Exec(
"INSERT INTO requests (service, ip, path, method, status, reason, created_at) VALUES (?, ?, ?, ?, ?, ?, ?)",
"INSERT INTO requests (service, ip, path, method, status, created_at) VALUES (?, ?, ?, ?, ?, ?)",
result.Service,
result.IP,
path,
method,
status,
reason,
time.Now().Format(time.RFC3339),
)
if err != nil {