Moved mindflowDB init up.
This commit is contained in:
parent
bf0787d8b6
commit
fb5188d565
@ -59,7 +59,13 @@ func main() {
|
||||
}
|
||||
defer guestbookDB.Close()
|
||||
|
||||
hand := http.NewHandlers(*captchaExpiry, *guestbookOwner, *guestbookPageSize, guestbookDB)
|
||||
mindflowDB, err := mfsqlite.New(path.Join(*databasesPath, "mindflow.sqlite"))
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
defer mindflowDB.Close()
|
||||
|
||||
hand := http.NewHandlers(*captchaExpiry, *guestbookOwner, *guestbookPageSize, guestbookDB, mindflowDB)
|
||||
defer hand.CloseDB()
|
||||
|
||||
srv := http.NewHttpServer()
|
||||
@ -95,12 +101,6 @@ func main() {
|
||||
srv.PATCH("/api/guestbook/:id/reply", guestbookApi.EditReply)
|
||||
srv.DELETE("/api/guestbook/:id/reply", guestbookApi.DeleteReply)
|
||||
|
||||
mindflowDB, err := mfsqlite.New(path.Join(*databasesPath, "mindflow.sqlite"))
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
defer mindflowDB.Close()
|
||||
|
||||
mindflowApi := http.NewMindflowApiHandlers(mindflowDB)
|
||||
|
||||
srv.POST("/api/mindflow", mindflowApi.New)
|
||||
|
Loading…
Reference in New Issue
Block a user