mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05: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:
parent
8dde3b2380
commit
67b1e3c5f2
1 changed files with 7 additions and 0 deletions
|
@ -65,6 +65,13 @@ func NewHandle(app string, ds datastore.DataStore, id string, numElements uint32
|
||||||
return nil, err
|
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
|
return h, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue