implement missing context
This commit is contained in:
@@ -16,6 +16,10 @@ type Storage struct {
|
||||
UserdataDb db.Db
|
||||
}
|
||||
|
||||
func (s *Storage) Close(ctx context.Context) error {
|
||||
return s.UserdataDb.Close(ctx)
|
||||
}
|
||||
|
||||
type StorageProvider interface {
|
||||
Get(sessionId string) (*Storage, error)
|
||||
Put(sessionId string, storage *Storage) error
|
||||
@@ -46,5 +50,5 @@ func (p *SimpleStorageProvider) Put(sessionId string, storage *Storage) error {
|
||||
}
|
||||
|
||||
func (p *SimpleStorageProvider) Close(ctx context.Context) error {
|
||||
return p.Storage.UserdataDb.Close(ctx)
|
||||
return p.Storage.Close(ctx)
|
||||
}
|
||||
|
||||
@@ -195,6 +195,7 @@ func (ms *MenuStorageService) ensureDbDir() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// TODO: how to handle persister here?
|
||||
func (ms *MenuStorageService) Close(ctx context.Context) error {
|
||||
errA := ms.stateStore.Close(ctx)
|
||||
errB := ms.userDataStore.Close(ctx)
|
||||
|
||||
Reference in New Issue
Block a user