mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-05-16 17:20:14 +00:00
nil check on db close
This commit is contained in:
@@ -19,6 +19,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"github.com/tinyauthapp/tinyauth/internal/model"
|
"github.com/tinyauthapp/tinyauth/internal/model"
|
||||||
"github.com/tinyauthapp/tinyauth/internal/repository"
|
"github.com/tinyauthapp/tinyauth/internal/repository"
|
||||||
"github.com/tinyauthapp/tinyauth/internal/service"
|
"github.com/tinyauthapp/tinyauth/internal/service"
|
||||||
@@ -173,7 +174,9 @@ func (app *BootstrapApp) Setup() error {
|
|||||||
defer func() {
|
defer func() {
|
||||||
app.cancel()
|
app.cancel()
|
||||||
app.wg.Wait()
|
app.wg.Wait()
|
||||||
|
if app.db != nil {
|
||||||
app.db.Close()
|
app.db.Close()
|
||||||
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// store
|
// store
|
||||||
|
|||||||
Reference in New Issue
Block a user