+ }
+
+ fn lock_manifest(
+ &self,
+ backup_dir: &BackupDir,
+ ) -> Result<File, Error> {
+ let mut path = self.base_path();
+ path.push(backup_dir.relative_path());
+ path.push(&MANIFEST_LOCK_NAME);
+
+ // update_manifest should never take a long time, so if someone else has
+ // the lock we can simply block a bit and should get it soon
+ open_file_locked(&path, Duration::from_secs(5), true)
+ .map_err(|err| {
+ format_err!(
+ "unable to acquire manifest lock {:?} - {}", &path, err
+ )
+ })
+ }