flounder

A simple gemini site builder
Log | Files | Refs | README | LICENSE

commit c0c3a51c0b50bdc8794a901f9c4cac9c4890dd52
parent cfafb492208f46510499512e66c64fbfd060af94
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Sat,  2 Jan 2021 13:39:06 -0800

update log writing

every 2 hours
log writing logs

Diffstat:
Mlog.go | 4++--
Mmain.go | 2+-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/log.go b/log.go @@ -231,7 +231,7 @@ func lineToLogLine(line string) (*LogLine, error) { } 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 @@ func dumpLogs() { ll.insertInto(db) counter += 1 } - fmt.Printf("Wrote %d logs\n", counter) + log.Printf("Wrote %d logs\n", counter) } func rotateLogs() { diff --git a/main.go b/main.go @@ -51,7 +51,7 @@ func main() { // handle background tasks s1 := gocron.NewScheduler(time.UTC) if c.AnalyticsDBFile != "" { - s1.Every(1).Day().Do(dumpLogs) // TODO Dont do on start? + s1.Every(2).Hour().Do(dumpLogs) // TODO Dont do on start? } switch args[0] {