Fix DB not closing on exit
This commit is contained in:
2
main.go
2
main.go
@@ -40,6 +40,7 @@ var (
|
||||
)
|
||||
|
||||
// TODO: Embed food.ddl and create DB if no exists
|
||||
// TODO: Add averages to graphs (ie. R2) https://stackoverflow.com/questions/60622195/how-to-draw-a-linear-regression-line-in-chart-js
|
||||
func main() {
|
||||
dbpath := flag.String("db", "food.db", "Path to the database file")
|
||||
flag.Parse()
|
||||
@@ -50,6 +51,7 @@ func main() {
|
||||
Error.Printf("%++v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
defer db.Close()
|
||||
|
||||
settingsService = &SettingsService{db: &db}
|
||||
err = settingsService.LoadSettings()
|
||||
|
Reference in New Issue
Block a user