Skip to content

Commit 7bb54de

Browse files
refactor(backend): Duration using a larger unit to be more readable (#12516)
# Motivation As per new lint rules (see https://github.com/dfinity/oisy-wallet/actions/runs/24709123056/job/72269196826?pr=12511), we need to make `Duration` more readable for larger units.
1 parent 00c86c3 commit 7bb54de

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/backend/src/utils/housekeeping.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ pub(crate) fn start_periodic_housekeeping_timers() {
129129
set_timer(immediate, spawn_housekeeping_if_idle);
130130

131131
// Then periodically:
132-
let hour = Duration::from_secs(60 * 60);
132+
let hour = Duration::from_hours(1);
133133
let _ = set_timer_interval(hour, spawn_housekeeping_if_idle);
134134
}
135135

src/backend/tests/it/signer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ fn test_housekeeping_lock_resets_after_failed_topup() {
235235
// (no cycles ledger) and must release the guard so the next tick can
236236
// spawn a new one.
237237
for _ in 0..3 {
238-
pic_setup.pic.advance_time(Duration::from_secs(60 * 60));
238+
pic_setup.pic.advance_time(Duration::from_hours(1));
239239
for _ in 0..10 {
240240
pic_setup.pic.tick();
241241
}
@@ -294,7 +294,7 @@ fn test_housekeeping_resumes_after_cycles_ledger_becomes_available() {
294294

295295
// Advance well past the first hourly interval and process messages, giving
296296
// the canister time to run housekeeping with a working cycles ledger.
297-
pic_setup.pic.advance_time(Duration::from_secs(2 * 60 * 60));
297+
pic_setup.pic.advance_time(Duration::from_hours(2));
298298
for _ in 0..20 {
299299
pic_setup.pic.tick();
300300
}

0 commit comments

Comments
 (0)