implement missing context

This commit is contained in:
lash
2025-01-19 09:35:09 +00:00
parent 37973a6c9b
commit ddd8d7cac0
4 changed files with 14 additions and 9 deletions

View File

@@ -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)
}

View File

@@ -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)