Skip to content

Commit

Permalink
chore: Fixed deprecation functions for rand
Browse files Browse the repository at this point in the history
  • Loading branch information
abdolence committed Feb 2, 2025
1 parent 68570d8 commit 0d1a1f6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/db/aggregated_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ impl FirestoreDb {
if db_err.retry_possible && retries < self.inner.options.max_retries =>
{
let sleep_duration = tokio::time::Duration::from_millis(
rand::thread_rng().gen_range(0..2u64.pow(retries as u32) * 1000 + 1),
rand::rng().random_range(0..2u64.pow(retries as u32) * 1000 + 1),
);
warn!(
err = %db_err,
Expand Down Expand Up @@ -413,7 +413,7 @@ impl FirestoreDb {
if db_err.retry_possible && retries < self.inner.options.max_retries =>
{
let sleep_duration = tokio::time::Duration::from_millis(
rand::thread_rng().gen_range(0..2u64.pow(retries as u32) * 1000 + 1),
rand::rng().random_range(0..2u64.pow(retries as u32) * 1000 + 1),
);
warn!(
err = %db_err,
Expand Down
2 changes: 1 addition & 1 deletion src/db/get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ impl FirestoreDb {
if db_err.retry_possible && retries < self.get_options().max_retries =>
{
let sleep_duration = tokio::time::Duration::from_millis(
rand::thread_rng().gen_range(0..2u64.pow(retries as u32) * 1000 + 1),
rand::rng().random_range(0..2u64.pow(retries as u32) * 1000 + 1),
);
span.in_scope(|| {
warn!(
Expand Down
4 changes: 2 additions & 2 deletions src/db/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ impl FirestoreDb {
if db_err.retry_possible && retries < db_inner.options.max_retries =>
{
let sleep_duration = tokio::time::Duration::from_millis(
rand::thread_rng().gen_range(0..2u64.pow(retries as u32) * 1000 + 1),
rand::rng().random_range(0..2u64.pow(retries as u32) * 1000 + 1),
);

warn!(
Expand Down Expand Up @@ -515,7 +515,7 @@ impl FirestoreDb {
if db_err.retry_possible && retries < self.inner.options.max_retries =>
{
let sleep_duration = tokio::time::Duration::from_millis(
rand::thread_rng().gen_range(0..2u64.pow(retries as u32) * 1000 + 1),
rand::rng().random_range(0..2u64.pow(retries as u32) * 1000 + 1),
);
warn!(
err = %db_err,
Expand Down
2 changes: 1 addition & 1 deletion src/db/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ impl FirestoreDb {
if db_err.retry_possible && retries < self.inner.options.max_retries =>
{
let sleep_duration = tokio::time::Duration::from_millis(
rand::thread_rng().gen_range(0..2u64.pow(retries as u32) * 1000 + 1),
rand::rng().random_range(0..2u64.pow(retries as u32) * 1000 + 1),
);
warn!(
err = %db_err,
Expand Down

0 comments on commit 0d1a1f6

Please sign in to comment.