fix: static generation should wait for file writes before resolving (#2994)

This commit is contained in:
Deep Gaurav 2024-09-20 01:06:54 +05:30 committed by GitHub
parent b0d8d4ee26
commit 27765b417c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -313,7 +313,6 @@ impl ResolvedStaticPath {
// awaiting the Future // awaiting the Future
_ = tx.send((owner.clone(), Some(html))); _ = tx.send((owner.clone(), Some(html)));
} else { } else {
_ = tx.send((owner.clone(), None));
if let Err(e) = writer(&self, &owner, html).await { if let Err(e) = writer(&self, &owner, html).await {
#[cfg(feature = "tracing")] #[cfg(feature = "tracing")]
tracing::warn!("{e}"); tracing::warn!("{e}");
@ -321,6 +320,7 @@ impl ResolvedStaticPath {
#[cfg(not(feature = "tracing"))] #[cfg(not(feature = "tracing"))]
eprintln!("{e}"); eprintln!("{e}");
} }
_ = tx.send((owner.clone(), None));
} }
// if there's a regeneration function, keep looping // if there's a regeneration function, keep looping