Skip to content

Commit

Permalink
improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
thedmdim committed Feb 5, 2024
1 parent f232e38 commit 5894ad2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,15 @@ func main() {
if err != nil {
log.Println("background random search: couldn't store found videos:", err.Error())
} else {
log.Println("background random search:", len(results), "found videos stored")
counters := make(map[int]int)
for _, video := range results {
year := time.Unix(video.UploadedAt, 0).Year()
counters[year]++
}
log.Println("background random search:", len(results), "found videos stored:")
for year, n := range counters {
log.Printf("%d videos from %d\n", n, year)
}
}
db.Put(conn)

Expand Down

0 comments on commit 5894ad2

Please sign in to comment.