From 6a9ad40e49d6b432a056872a57c985b8c7623a38 Mon Sep 17 00:00:00 2001 From: Ravi Sawlani <152961362+ravi-sawlani-yral@users.noreply.github.com> Date: Tue, 3 Dec 2024 16:35:12 +0530 Subject: [PATCH] fix: re-enqueue timers issue (#476) * fix re-enqueue timers issue * fix once re-enqueue method --- .../reenqueue_timers_for_pending_bet_outcomes.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/canister/individual_user_template/src/api/hot_or_not_bet/reenqueue_timers_for_pending_bet_outcomes.rs b/src/canister/individual_user_template/src/api/hot_or_not_bet/reenqueue_timers_for_pending_bet_outcomes.rs index 26d37b47..dcaf0dad 100644 --- a/src/canister/individual_user_template/src/api/hot_or_not_bet/reenqueue_timers_for_pending_bet_outcomes.rs +++ b/src/canister/individual_user_template/src/api/hot_or_not_bet/reenqueue_timers_for_pending_bet_outcomes.rs @@ -56,7 +56,7 @@ fn reenqueue_timers_for_these_posts( .duration_since(*current_time) .unwrap_or_default(), move || { - tabulate_hot_or_not_outcome_for_post_slot(post_id, slot_id); + ic_cdk::spawn(tabulate_hot_or_not_outcome_for_post_slot(post_id, slot_id)); }, ); }) @@ -89,7 +89,10 @@ fn once_reenqueue_timers_for_these_posts(post_slot_ids: Vec<(u64, u8)>) { // random jitter Duration::from_secs(300), move || { - tabulate_hot_or_not_outcome_for_post_slot(post_id, slot_number); + ic_cdk::spawn(tabulate_hot_or_not_outcome_for_post_slot( + post_id, + slot_number, + )); }, ); }