diff --git a/cmd/sekret.link/main.go b/cmd/sekret.link/main.go index 1b20159..12d64b8 100644 --- a/cmd/sekret.link/main.go +++ b/cmd/sekret.link/main.go @@ -183,7 +183,12 @@ func main() { fmt.Fprintf(os.Stderr, "error: %s", err) os.Exit(1) } - go scheduleDeleteExpired(ctx, handlerConfig.DB) + go func() { + err := scheduleDeleteExpired(ctx, handlerConfig.DB) + if err != nil { + slog.Error("Error deleting expired entries", "error", err) + } + }() httpServer := listen(*handlerConfig) termChan := make(chan os.Signal) diff --git a/internal/services/entrymanager_test.go b/internal/services/entrymanager_test.go index efe2dbc..b8c52e0 100644 --- a/internal/services/entrymanager_test.go +++ b/internal/services/entrymanager_test.go @@ -272,7 +272,7 @@ func TestReadEntryError(t *testing.T) { service := NewEntryManager(db, entryModel, crypto, keyManager) data, err := service.ReadEntry(ctx, "uuid", []byte("key")) - assert.Error(t, ErrEntryNotFound) + assert.Error(t, err, ErrEntryNotFound) assert.Nil(t, data) entryModel.AssertExpectations(t)