Skip to content

Commit b98f50f

Browse files
devin-ai-integration[bot]Convex, Inc.
authored andcommitted
Use lease_lost_error helper in LeaderRetentionManager::advance_timestamp (#37252)
# Use lease_lost_error helper in LeaderRetentionManager::advance_timestamp ## Description This PR changes the direct `LeaseLostError` creation in `LeaderRetentionManager::advance_timestamp` to use the `lease_lost_error` helper function. ## Changes - Added import for `lease_lost_error` from `common::errors` - Replaced direct `anyhow::Error::new(LeaseLostError)` with `lease_lost_error()` ## Testing - Ran `just format-rust` and `just lint-rust database` GitOrigin-RevId: be565b3690a483373606cb0f99e4db9d8c9b31ff
1 parent d4f82bd commit b98f50f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/database/src/retention.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ use common::{
3333
ResolvedDocument,
3434
},
3535
errors::{
36+
lease_lost_error,
3637
report_error,
3738
LeaseLostError,
3839
},
@@ -459,9 +460,8 @@ impl<RT: Runtime> LeaderRetentionManager<RT> {
459460
// timestamp.
460461
// We want to signal that the instance should shut down if that's the case.
461462
if let Some(LeaseLostError) = e.downcast_ref() {
462-
lease_lost_shutdown.signal(
463-
anyhow::Error::new(LeaseLostError).context("Failed to advance timestamp"),
464-
);
463+
lease_lost_shutdown
464+
.signal(lease_lost_error().context("Failed to advance timestamp"));
465465
}
466466
return Err(e);
467467
}

0 commit comments

Comments
 (0)