merge fix
This commit is contained in:
commit
e5a18ae047
2 changed files with 3 additions and 2 deletions
|
@ -8,6 +8,7 @@ RUN cargo build --release
|
|||
FROM debian:buster
|
||||
|
||||
RUN apt update && apt upgrade -y
|
||||
RUN apt install -y gnupg ca-certificates openssl
|
||||
|
||||
COPY --from=builder /app/target/release/mirrord /mirrord
|
||||
|
||||
|
|
|
@ -122,9 +122,8 @@ impl Mirror {
|
|||
}
|
||||
|
||||
// check if cache should be used
|
||||
if !self.no_cache.is_match(path) || !self.is_cache_invalid(&p) {
|
||||
Self::create_cache_dir(p.parent().unwrap());
|
||||
|
||||
if !self.no_cache.is_match(path) || !self.is_cache_invalid(&p) {
|
||||
// use cache if present
|
||||
if let Some(resp) = self.fetch_cache(&p, req).await {
|
||||
log::info!("Returning {path} from cache");
|
||||
|
@ -219,6 +218,7 @@ impl Mirror {
|
|||
let status_code = response.status();
|
||||
let body_bytes = response.bytes().await.ok()?;
|
||||
if status_code.is_success() {
|
||||
log::debug!("Writing request to {save:?}");
|
||||
std::fs::write(save, &body_bytes).unwrap();
|
||||
}
|
||||
let mut http_response = HttpResponse::build(
|
||||
|
|
Loading…
Add table
Reference in a new issue