From 27765b417cca5e380a983b023fa581e1bfc6e6fe Mon Sep 17 00:00:00 2001 From: Deep Gaurav Date: Fri, 20 Sep 2024 01:06:54 +0530 Subject: [PATCH] fix: static generation should wait for file writes before resolving (#2994) --- router/src/static_routes.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/router/src/static_routes.rs b/router/src/static_routes.rs index 5e0acdf58..a71ed9661 100644 --- a/router/src/static_routes.rs +++ b/router/src/static_routes.rs @@ -313,7 +313,6 @@ impl ResolvedStaticPath { // awaiting the Future _ = tx.send((owner.clone(), Some(html))); } else { - _ = tx.send((owner.clone(), None)); if let Err(e) = writer(&self, &owner, html).await { #[cfg(feature = "tracing")] tracing::warn!("{e}"); @@ -321,6 +320,7 @@ impl ResolvedStaticPath { #[cfg(not(feature = "tracing"))] eprintln!("{e}"); } + _ = tx.send((owner.clone(), None)); } // if there's a regeneration function, keep looping