Temporary solution for make sure storage object gets put back in all cases of execution
This commit is contained in:
@@ -11,31 +11,31 @@ type Storage struct {
|
||||
}
|
||||
|
||||
type StorageProvider interface {
|
||||
Get(sessionId string) (Storage, error)
|
||||
Put(sessionId string, storage Storage) error
|
||||
Get(sessionId string) (*Storage, error)
|
||||
Put(sessionId string, storage *Storage) error
|
||||
Close() error
|
||||
}
|
||||
|
||||
type SimpleStorageProvider struct {
|
||||
Storage
|
||||
*Storage
|
||||
}
|
||||
|
||||
func NewSimpleStorageProvider(stateStore db.Db, userdataStore db.Db) StorageProvider {
|
||||
pe := persist.NewPersister(stateStore)
|
||||
pe = pe.WithFlush()
|
||||
return &SimpleStorageProvider{
|
||||
Storage: Storage{
|
||||
Storage: &Storage{
|
||||
Persister: pe,
|
||||
UserdataDb: userdataStore,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (p *SimpleStorageProvider) Get(sessionId string) (Storage, error) {
|
||||
func (p *SimpleStorageProvider) Get(sessionId string) (*Storage, error) {
|
||||
return p.Storage, nil
|
||||
}
|
||||
|
||||
func (p *SimpleStorageProvider) Put(sessionId string, storage Storage) error {
|
||||
func (p *SimpleStorageProvider) Put(sessionId string, storage *Storage) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user