diff options
| author | Franck Cuny <franck@fcuny.net> | 2025-08-29 09:29:07 -0700 |
|---|---|---|
| committer | Franck Cuny <franck@fcuny.net> | 2025-08-29 09:31:14 -0700 |
| commit | c7598b0ee2bf47d7a37c7189143749acc0491ade (patch) | |
| tree | a827d9a066723a2d8763396745465dc26217af8d /internal/scrobbler | |
| parent | check returned error when running the scrobbler (diff) | |
| download | x-c7598b0ee2bf47d7a37c7189143749acc0491ade.tar.gz | |
don't check errors
Diffstat (limited to '')
| -rw-r--r-- | internal/scrobbler/db.go | 7 | ||||
| -rw-r--r-- | internal/scrobbler/scrobbler.go | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/internal/scrobbler/db.go b/internal/scrobbler/db.go index 7b97b82..1125798 100644 --- a/internal/scrobbler/db.go +++ b/internal/scrobbler/db.go @@ -3,6 +3,7 @@ package scrobbler import ( "database/sql" "fmt" + "log" "os" _ "github.com/mattn/go-sqlite3" @@ -17,7 +18,11 @@ func initdb(dbpath string) error { if err != nil { return err } - defer db.Close() + defer func() { + if err := db.Close(); err != nil { + log.Printf("failed to close database: %v", err) + } + }() sqlStmt := `create table records (id text primary key, title text, diff --git a/internal/scrobbler/scrobbler.go b/internal/scrobbler/scrobbler.go index 694f9ff..8cb8f9e 100644 --- a/internal/scrobbler/scrobbler.go +++ b/internal/scrobbler/scrobbler.go @@ -89,7 +89,7 @@ func (s *Scrobbler) Run() error { log.Printf("failed to update record %s: %s", previousRecord.Id, err) } previousRecord = currentRecord - s.save(currentRecord) + _ = s.save(currentRecord) } } } |
