update log writing every 2 hours log writing logs
alex wennerberg alex@alexwennerberg.com
Sat, 02 Jan 2021 13:39:06 -0800
M
log.go
→
log.go
@@ -231,7 +231,7 @@ return &result, nil
} func dumpLogs() { - fmt.Println("Writing missing logs to database") + log.Println("Writing missing logs to database") db := getAnalyticsDB() var maxTime string row := db.QueryRow(`SELECT timestamp from log order by timestamp desc limit 1`)@@ -264,7 +264,7 @@ }
ll.insertInto(db) counter += 1 } - fmt.Printf("Wrote %d logs\n", counter) + log.Printf("Wrote %d logs\n", counter) } func rotateLogs() {