Dustin C. Hatch 666ae19efd page: Fix tracing span in save_page
Span guards (i.e. `Span::enter`) cannot be used in asynchronous
methods:

> The drop guard returned by Span::enter exits the span when it is
> dropped. When an async function or async block yields at an .await
> point, the current scope is exited, but values in that scope are not
> dropped (because the async block will eventually resume execution
> from that await point). This means that another task will begin
> executing while remaining in the entered span. This results in an
> incorrect trace.

https://docs.rs/tracing/0.1.41/tracing/span/struct.Span.html#in-asynchronous-code

Instead, we can use the `instrument` attribute macro, which correctly
instruments asynchronous functions.  I originally did not use this
macro because it logs all function parameters' values by default, which
means every log line emitted while in the span contained the entire
contents of the page being saved.  Fortunately, I discovered you can
omit certain parameters using `skip`.
2025-04-18 10:15:10 -05:00
2025-04-05 17:07:39 -05:00
2025-04-18 10:15:10 -05:00
2025-04-08 21:50:14 -05:00
2025-04-08 21:40:20 -05:00
2025-04-05 17:07:19 -05:00
Description
No description provided
212 KiB
Languages
Rust 93.1%
Shell 6.5%
Just 0.4%