Change status _after_ calling StoreEntry::get_entry()
StoreEntry::get_entry() will return an error if the store entry's status is "borrowed".
This commit is contained in:
parent
6c53f172dc
commit
c6ec47a8af
1 changed files with 2 additions and 1 deletions
|
@ -147,8 +147,9 @@ impl Store {
|
|||
.map_err(|_| StoreError::new(StoreErrorKind::LockPoisoned, None))
|
||||
.and_then(|mut es| {
|
||||
let mut se = es.entry(id.clone()).or_insert_with(|| StoreEntry::new(id.clone()));
|
||||
let entry = se.get_entry();
|
||||
se.status = StoreEntryStatus::Borrowed;
|
||||
se.get_entry()
|
||||
entry
|
||||
})
|
||||
.map(|e| FileLockEntry::new(self, e, id))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue