Fix: fix db migrations and add new row viewed
All checks were successful
CI.yml / build (push) Successful in 1m54s
All checks were successful
CI.yml / build (push) Successful in 1m54s
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user