diff options
Diffstat (limited to 'storage/transactional/object.go')
-rw-r--r-- | storage/transactional/object.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/storage/transactional/object.go b/storage/transactional/object.go index 2a46d3c..21490b7 100644 --- a/storage/transactional/object.go +++ b/storage/transactional/object.go @@ -61,3 +61,15 @@ func (o *ObjectStorage) IterEncodedObjects(t plumbing.ObjectType) (storer.Encode temporalIter, }), nil } + +func (o *ObjectStorage) Commit() error { + iter, err := o.temporal.IterEncodedObjects(plumbing.AnyObject) + if err != nil { + return err + } + + return iter.ForEach(func(obj plumbing.EncodedObject) error { + _, err := o.EncodedObjectStorer.SetEncodedObject(obj) + return err + }) +} |