diff options
author | Matthias Beyer <matthias.beyer@atos.net> | 2021-01-28 11:36:37 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2021-02-11 18:40:48 +0100 |
commit | a2ba53f129b8db18a501aaae946fd0e921a23ca8 (patch) | |
tree | 93b57c2fd5461152d855a7b83905530686da6d32 /src | |
parent | 8355ab62906035c95b119529c8acfbf89aa5f160 (diff) |
Add MergedStores::get() for getting artifact pathes from any store
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/filestore/merged.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/filestore/merged.rs b/src/filestore/merged.rs index 5238ed5..7363eb2 100644 --- a/src/filestore/merged.rs +++ b/src/filestore/merged.rs @@ -80,4 +80,12 @@ impl MergedStores { Ok(None) } + + pub async fn get(&self, p: &ArtifactPath) -> Option<ArtifactPath> { + if let Some(a) = self.staging.read().await.get(p).cloned() { + return Some(a) + } + + self.release.read().await.get(p).cloned() + } } |