Skip to content

Commit

Permalink
Fix lint errors, check return values in db close.
Browse files Browse the repository at this point in the history
  • Loading branch information
airforce270 committed Aug 17, 2024
1 parent ac0df7e commit ca82fdf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ func close(db *gorm.DB) error {
return fmt.Errorf("failed to get DB handle: %w", err)
}

d.Exec("PRAGMA analysis_limit = 400;")
d.Exec("PRAGMA optimize;")
if _, err := d.Exec("PRAGMA analysis_limit = 400;"); err != nil {
return fmt.Errorf("failed to set analysis_limit: %w", err)
}
if _, err := d.Exec("PRAGMA optimize;"); err != nil {
return fmt.Errorf("failed to run optimize: %w", err)
}

return nil
}
Expand Down

0 comments on commit ca82fdf

Please sign in to comment.