Skip to content

Commit 2d35c94

Browse files
committed
Invalidate manifests.txt after updating it
This ensures that the file is *really* up to date.
1 parent 95f7395 commit 2d35c94

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/main.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ impl Context {
258258

259259
self.invalidate_releases()?;
260260
self.update_manifests_txt()?;
261+
self.invalidate_manifests_txt()?;
261262

262263
// Clean up after ourselves to avoid leaving gigabytes of artifacts
263264
// around.
@@ -598,8 +599,16 @@ impl Context {
598599
// https://github.com/rust-lang/simpleinfra/pull/295
599600
let paths = ["/dist/*".into()];
600601

601-
self.invalidate_cloudfront(&self.config.cloudfront_static_id, &paths)?;
602-
self.invalidate_fastly(&paths)?;
602+
self.invalidate_all_cdns(&paths)
603+
}
604+
605+
fn invalidate_manifests_txt(&self) -> Result<(), Error> {
606+
self.invalidate_all_cdns(&["manifests.txt".into()])
607+
}
608+
609+
fn invalidate_all_cdns(&self, paths: &[String]) -> Result<(), Error> {
610+
self.invalidate_cloudfront(&self.config.cloudfront_static_id, paths)?;
611+
self.invalidate_fastly(paths)?;
603612

604613
Ok(())
605614
}

0 commit comments

Comments
 (0)