Properly close store
This commit is contained in:
parent
709353b46e
commit
c15f3f70ab
1
main.go
1
main.go
|
@ -14,6 +14,7 @@ func main() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
defer db.Close()
|
||||||
handlers := transport.New(db)
|
handlers := transport.New(db)
|
||||||
// Auth endpoints
|
// Auth endpoints
|
||||||
mux.Group(func(mux *flow.Mux) {
|
mux.Group(func(mux *flow.Mux) {
|
||||||
|
|
|
@ -34,6 +34,7 @@ type Storer interface {
|
||||||
SessionUser(token string) (User, error)
|
SessionUser(token string) (User, error)
|
||||||
SaveOauthState(state OauthState) error
|
SaveOauthState(state OauthState) error
|
||||||
OauthState(id string) (OauthState, error)
|
OauthState(id string) (OauthState, error)
|
||||||
|
Close() error
|
||||||
}
|
}
|
||||||
|
|
||||||
type OauthState struct {
|
type OauthState struct {
|
||||||
|
@ -349,3 +350,7 @@ func (s *Store) OauthState(id string) (OauthState, error) {
|
||||||
}
|
}
|
||||||
return state, nil
|
return state, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *Store) Close() error {
|
||||||
|
return s.database.Close()
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue