summaryrefslogtreecommitdiff
path: root/src/registry.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/registry.rs')
-rw-r--r--src/registry.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/registry.rs b/src/registry.rs
index c1ab4b7..c4eefdd 100644
--- a/src/registry.rs
+++ b/src/registry.rs
@@ -6,7 +6,7 @@ use std::collections::HashMap;
pub trait Registries {
fn get_tags(&self, registry: &str, image: &str) -> Option<Vec<String>>;
fn get_digest(&self, registry: &str, image: &str, tag: &str) -> Option<String>;
- fn get_cache_ttl(&self, registry: &str) -> chrono::Duration;
+ fn get_cache_ttl(&self, registry: &str) -> std::time::Duration;
}
#[derive(Debug)]
@@ -48,7 +48,7 @@ pub enum Credentials {
pub struct Config {
pub host: String,
pub credentials: Credentials,
- pub cache_ttl: chrono::Duration,
+ pub cache_ttl: std::time::Duration,
}
enum AuthStage {
@@ -314,12 +314,12 @@ impl Registries for HttpRegistry {
return Some(digest);
}
- fn get_cache_ttl(&self, registry: &str) -> chrono::Duration {
+ fn get_cache_ttl(&self, registry: &str) -> std::time::Duration {
let auth = self.auth.borrow();
if let Some(state) = auth.get(registry) {
return state.config.cache_ttl;
}
- return chrono::Duration::minutes(1440);
+ return std::time::Duration::from_secs(86400);
}
}
@@ -389,8 +389,8 @@ impl Registries for StubRegistry {
return None;
}
- fn get_cache_ttl(&self, _registry: &str) -> chrono::Duration {
- return chrono::Duration::minutes(1440);
+ fn get_cache_ttl(&self, _registry: &str) -> std::time::Duration {
+ return std::time::Duration::from_secs(86400);
}
}