Implement: execute_post_update_hooks()
This commit is contained in:
parent
7014256407
commit
f703e8a4cd
1 changed files with 13 additions and 2 deletions
|
@ -490,8 +490,19 @@ impl Store {
|
||||||
.map_err(|e| StoreError::new(StoreErrorKind::PreHookExecuteError, Some(Box::new(e))))
|
.map_err(|e| StoreError::new(StoreErrorKind::PreHookExecuteError, Some(Box::new(e))))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn execute_post_update_hooks(&self, id: &FileLockEntry) -> Result<()> {
|
pub fn execute_post_update_hooks(&self, fle: &FileLockEntry) -> Result<()> {
|
||||||
unimplemented!()
|
self.post_update_hooks
|
||||||
|
.deref()
|
||||||
|
.lock()
|
||||||
|
.map_err(|e| StoreError::new(StoreErrorKind::PostHookExecuteError, None))
|
||||||
|
.and_then(|guard| {
|
||||||
|
guard.deref()
|
||||||
|
.iter()
|
||||||
|
.fold(Ok(()), move |res, hook| res.and_then(|_| hook.post_update(fle)))
|
||||||
|
.map_err(|e| {
|
||||||
|
StoreError::new(StoreErrorKind::PostHookExecuteError, Some(Box::new(e)))
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn execute_pre_delete_hooks(&self, id: &StoreId) -> Result<()> {
|
pub fn execute_pre_delete_hooks(&self, id: &StoreId) -> Result<()> {
|
||||||
|
|
Loading…
Reference in a new issue