Fix check if job is already done
This commit is contained in:
parent
fe51492c5b
commit
3c2ad0ea0b
@ -193,7 +193,7 @@ impl BenchmarkRepository
|
|||||||
benchmark_repository
|
benchmark_repository
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn file_exists(&self, file_path: &Path, branch_name: &str) -> bool
|
pub fn directory_exists(&self, directory_path: &Path, branch_name: &str) -> bool
|
||||||
{
|
{
|
||||||
let tip_reference_name = format!("refs/remotes/origin/{}", branch_name);
|
let tip_reference_name = format!("refs/remotes/origin/{}", branch_name);
|
||||||
let tip_reference = match self.repository.find_reference(&tip_reference_name)
|
let tip_reference = match self.repository.find_reference(&tip_reference_name)
|
||||||
@ -208,13 +208,13 @@ impl BenchmarkRepository
|
|||||||
Err(error) => panic!("Could not peel reference to tree: {}", error),
|
Err(error) => panic!("Could not peel reference to tree: {}", error),
|
||||||
};
|
};
|
||||||
|
|
||||||
let object_id = match tree.get_path(file_path)
|
let object_id = match tree.get_path(directory_path)
|
||||||
{
|
{
|
||||||
Ok(tree_entry) => tree_entry.id(),
|
Ok(tree_entry) => tree_entry.id(),
|
||||||
Err(_) => return false,
|
Err(_) => return false,
|
||||||
};
|
};
|
||||||
|
|
||||||
if let Err(_) = self.repository.find_blob(object_id)
|
if let Err(_) = self.repository.find_tree(object_id)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -260,7 +260,7 @@ impl BenchmarkRepository
|
|||||||
|
|
||||||
pub fn is_job_done(&self, key: &str) -> bool
|
pub fn is_job_done(&self, key: &str) -> bool
|
||||||
{
|
{
|
||||||
self.file_exists(Path::new(key), "results")
|
self.directory_exists(Path::new(key), "results")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn create_job(&mut self, key: String) -> &Job
|
pub fn create_job(&mut self, key: String) -> &Job
|
||||||
|
Loading…
Reference in New Issue
Block a user