Fix in bitseq.NewHandle()

- When creating the handle, write it to store if
  not present. Currently it is written to store
  only on first bit allocation.

Signed-off-by: Alessandro Boch <aboch@docker.com>
This commit is contained in:
Alessandro Boch
2015-10-03 20:23:26 -07:00
parent 0bf5afe28c
commit d8565d27b7
+7
View File
@@ -65,6 +65,13 @@ func NewHandle(app string, ds datastore.DataStore, id string, numElements uint32
return nil, err
}
// If the handle is not in store, write it.
if !h.Exists() {
if err := h.writeToStore(); err != nil {
return nil, fmt.Errorf("failed to write bitsequence to store: %v", err)
}
}
return h, nil
}