mirror of
https://github.com/clearlinux/libnetwork.git
synced 2026-08-21 05:28:10 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user