Skip to content

Commit

Permalink
fix(sqlite): don't unwrap in requeue_message (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Zinkovsky authored Nov 21, 2023
1 parent 0dbd088 commit 59efb1d
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions sqlite/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -574,16 +574,15 @@ fn requeue_message(
// Requeue based on backoff schedule
let new_ts = now + Duration::from_millis(backoff_schedule[0]);
let new_backoff_schedule = serde_json::to_string(&backoff_schedule[1..])?;
let changed = tx
.prepare_cached(STATEMENT_QUEUE_ADD_READY)?
.execute(params![
new_ts.timestamp_millis(),
id,
&data,
&new_backoff_schedule,
&keys_if_undelivered
])
.unwrap();
let changed =
tx.prepare_cached(STATEMENT_QUEUE_ADD_READY)?
.execute(params![
new_ts.timestamp_millis(),
id,
&data,
&new_backoff_schedule,
&keys_if_undelivered
])?;
assert_eq!(changed, 1);
requeued = true;
} else if !keys_if_undelivered.is_empty() {
Expand Down

0 comments on commit 59efb1d

Please sign in to comment.