diff options
| author | Xe Iaso <me@christine.website> | 2022-09-21 02:31:43 +0000 |
|---|---|---|
| committer | Xe Iaso <me@christine.website> | 2022-09-21 02:31:43 +0000 |
| commit | 49c62851137d2757d6e8019636c908b4612f61d1 (patch) | |
| tree | 141577daeb9f3e89def22fa930ea4fcbf3622813 /src/app | |
| parent | 292c43392102cde951d345cf012e0231826877a5 (diff) | |
| download | xesite-49c62851137d2757d6e8019636c908b4612f61d1.tar.xz xesite-49c62851137d2757d6e8019636c908b4612f61d1.zip | |
purge cloudflare
Signed-off-by: Xe Iaso <me@christine.website>
Diffstat (limited to 'src/app')
| -rw-r--r-- | src/app/mod.rs | 6 | ||||
| -rw-r--r-- | src/app/poke.rs | 48 |
2 files changed, 3 insertions, 51 deletions
diff --git a/src/app/mod.rs b/src/app/mod.rs index 9a331a4..73320e1 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -68,9 +68,9 @@ pub async fn init(cfg: PathBuf) -> Result<State> { cfg.clone().mi_token.clone(), crate::APPLICATION_NAME.to_string(), )?; - let blog = crate::post::load(cfg.clone(), "blog").await?; - let gallery = crate::post::load(cfg.clone(), "gallery").await?; - let talks = crate::post::load(cfg.clone(), "talks").await?; + let blog = crate::post::load("blog").await?; + let gallery = crate::post::load("gallery").await?; + let talks = crate::post::load("talks").await?; let mut everything: Vec<Post> = vec![]; { diff --git a/src/app/poke.rs b/src/app/poke.rs index ef5f882..404b14d 100644 --- a/src/app/poke.rs +++ b/src/app/poke.rs @@ -7,18 +7,9 @@ pub async fn the_cloud() -> Result<()> { info!("waiting for things to settle"); delay_for(Duration::from_secs(10)).await; - info!("purging cloudflare cache"); - cloudflare().await?; - - info!("waiting for the cloudflare cache to purge globally"); - delay_for(Duration::from_secs(45)).await; - info!("poking mi"); mi().await?; - info!("poking bing"); - bing().await?; - info!("poking google"); google().await?; @@ -26,19 +17,6 @@ pub async fn the_cloud() -> Result<()> { } #[instrument(err)] -async fn bing() -> Result<()> { - let cli = reqwest::Client::new(); - cli.get("https://www.bing.com/ping") - .query(&[("sitemap", "https://xeiaso.net/sitemap.xml")]) - .header("User-Agent", crate::APPLICATION_NAME) - .send() - .await? - .error_for_status()?; - - Ok(()) -} - -#[instrument(err)] async fn google() -> Result<()> { let cli = reqwest::Client::new(); cli.get("https://www.google.com/ping") @@ -52,32 +30,6 @@ async fn google() -> Result<()> { } #[instrument(err)] -async fn cloudflare() -> Result<()> { - let cli = cfcache::Client::new(env::var("CF_TOKEN")?, env::var("CF_ZONE_ID")?)?; - cli.purge( - vec![ - "https://xeiaso.net/sitemap.xml", - "https://xeiaso.net", - "https://xeiaso.net/blog", - "https://xeiaso.net/blog.atom", - "https://xeiaso.net/blog.json", - "https://xeiaso.net/blog.rss", - "https://xeiaso.net/gallery", - "https://xeiaso.net/talks", - "https://xeiaso.net/resume", - "https://xeiaso.net/signalboost", - "https://xeiaso.net/feeds", - ] - .into_iter() - .map(|i| i.to_string()) - .collect(), - ) - .await?; - - Ok(()) -} - -#[instrument(err)] async fn mi() -> Result<()> { let cli = mi::Client::new(env::var("MI_TOKEN")?, crate::APPLICATION_NAME.to_string())?; cli.refresh().await?; |
