Add debug output in Store::create()
This commit is contained in:
parent
e88c5011ab
commit
c4584bf1ca
1 changed files with 6 additions and 0 deletions
|
@ -333,6 +333,8 @@ impl Store {
|
||||||
pub fn create<'a, S: IntoStoreId>(&'a self, id: S) -> Result<FileLockEntry<'a>> {
|
pub fn create<'a, S: IntoStoreId>(&'a self, id: S) -> Result<FileLockEntry<'a>> {
|
||||||
let id = try!(id.into_storeid()).with_base(self.path().clone());
|
let id = try!(id.into_storeid()).with_base(self.path().clone());
|
||||||
|
|
||||||
|
debug!("Creating id: '{}'", id);
|
||||||
|
|
||||||
{
|
{
|
||||||
let mut hsmap = match self.entries.write() {
|
let mut hsmap = match self.entries.write() {
|
||||||
Err(_) => return Err(SEK::LockPoisoned.into_error()).map_err_into(SEK::CreateCallError),
|
Err(_) => return Err(SEK::LockPoisoned.into_error()).map_err_into(SEK::CreateCallError),
|
||||||
|
@ -340,15 +342,19 @@ impl Store {
|
||||||
};
|
};
|
||||||
|
|
||||||
if hsmap.contains_key(&id) {
|
if hsmap.contains_key(&id) {
|
||||||
|
debug!("Cannot create, internal cache already contains: '{}'", id);
|
||||||
return Err(SEK::EntryAlreadyExists.into_error()).map_err_into(SEK::CreateCallError);
|
return Err(SEK::EntryAlreadyExists.into_error()).map_err_into(SEK::CreateCallError);
|
||||||
}
|
}
|
||||||
hsmap.insert(id.clone(), {
|
hsmap.insert(id.clone(), {
|
||||||
|
debug!("Creating: '{}'", id);
|
||||||
let mut se = try!(StoreEntry::new(id.clone()));
|
let mut se = try!(StoreEntry::new(id.clone()));
|
||||||
se.status = StoreEntryStatus::Borrowed;
|
se.status = StoreEntryStatus::Borrowed;
|
||||||
se
|
se
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
debug!("Constructing FileLockEntry: '{}'", id);
|
||||||
|
|
||||||
Ok(FileLockEntry::new(self, Entry::new(id)))
|
Ok(FileLockEntry::new(self, Entry::new(id)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue