Skip to content

Commit 51b2431

Browse files
authored
Merge pull request #9 from fpco/report-errors-on-stale
Report errors on stale cache
2 parents dbf801e + abf8512 commit 51b2431

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
2727
- uses: dtolnay/rust-toolchain@master
2828
with:
29-
toolchain: 1.81.0
29+
toolchain: 1.89.0
3030
components: rustfmt, clippy
3131
- name: Compile
3232
run: just cargo-compile

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[toolchain]
2-
channel = "1.84.0"
2+
channel = "1.89.0"

src/lib.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -419,11 +419,15 @@ impl<Loader: CacheLoader> AsyncLoader<Loader> {
419419
ValueForRender::Success { .. } => result,
420420
ValueForRender::Error {
421421
stale_cache: Some(stale_cache),
422-
..
423-
} => ValueForRender::Success {
424-
value: stale_cache.value,
425-
loaded: stale_cache.loaded,
426-
},
422+
message,
423+
status,
424+
} => {
425+
tracing::error!("AsyncLoader::get_value_allow_stale: using stale cache, status=={status}, message: {message}");
426+
ValueForRender::Success {
427+
value: stale_cache.value,
428+
loaded: stale_cache.loaded,
429+
}
430+
}
427431
ValueForRender::Error { .. } => result,
428432
}
429433
}

0 commit comments

Comments
 (0)