Closed abhishek-tripathi-yral closed 3 weeks ago
What is the use of slot_details_map?
GET active_room_id when bet is placed
slot_details_map is EMPTY for all canisters. .insert
doesn't work.
Hypothesis: This is timer spawn code in add_post_v2. creator_consent_for_inclusion_in_hot_or_not is False by default and hence timers are not being launched. canister updates however are launching timers due to which game resolves for few slots of few posts (since hot_or_not_details is Some by then)
if post_details.creator_consent_for_inclusion_in_hot_or_not { <------------ likely culprit
// * schedule hot_or_not outcome tabulation for the 48 hours after the post is created
(1..=48).for_each(|slot_number: u8| {
ic_cdk_timers::set_timer(
Duration::from_secs(slot_number as u64 * 60 * 60),
move || {
CANISTER_DATA.with(|canister_data_ref_cell| {
tabulate_hot_or_not_outcome_for_post_slot(
&mut canister_data_ref_cell.borrow_mut(),
post_id,
slot_number,
);
});
},
);
})
}
Agree partially with the hypothesis given above. This is ONE of the reasons why timers are stuck.
Why I think there could be more reasons => https://github.com/go-bazzinga/hot-or-not-backend-canister/pull/389#discussion_r1741444518
updated tests in the PR.
@abeeshake-yral We were firing all request at once and not 25 request at a time, we are now rectifying the same. This should get the issue resolved.
komal's very useful input
slot_details_map
is empty.