From 7031f0ccb4703717b80fc0062e7c231630cefc58 Mon Sep 17 00:00:00 2001 From: Hamish Peebles Date: Sat, 14 Dec 2024 23:30:40 +0000 Subject: [PATCH] Log error if end video call job fails --- backend/canisters/community/impl/src/timer_job_types.rs | 5 ++++- backend/canisters/group/impl/src/timer_job_types.rs | 5 ++++- backend/canisters/user/impl/src/timer_job_types.rs | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/backend/canisters/community/impl/src/timer_job_types.rs b/backend/canisters/community/impl/src/timer_job_types.rs index 638e36d6c6..2c3c1cfaa5 100644 --- a/backend/canisters/community/impl/src/timer_job_types.rs +++ b/backend/canisters/community/impl/src/timer_job_types.rs @@ -447,6 +447,9 @@ impl Job for MarkP2PSwapExpiredJob { impl Job for MarkVideoCallEndedJob { fn execute(self) { - mutate_state(|state| end_video_call_impl(self.0, state)); + let response = mutate_state(|state| end_video_call_impl(self.0.clone(), state)); + if !matches!(response, community_canister::end_video_call::Response::Success) { + error!(?response, args = ?self.0, "Failed to mark video call ended"); + } } } diff --git a/backend/canisters/group/impl/src/timer_job_types.rs b/backend/canisters/group/impl/src/timer_job_types.rs index 55ff5c02cb..05e108e230 100644 --- a/backend/canisters/group/impl/src/timer_job_types.rs +++ b/backend/canisters/group/impl/src/timer_job_types.rs @@ -386,6 +386,9 @@ impl Job for MarkP2PSwapExpiredJob { impl Job for MarkVideoCallEndedJob { fn execute(self) { - mutate_state(|state| end_video_call_impl(self.0, state)); + let response = mutate_state(|state| end_video_call_impl(self.0.clone(), state)); + if !matches!(response, group_canister::end_video_call::Response::Success) { + error!(?response, args = ?self.0, "Failed to mark video call ended"); + } } } diff --git a/backend/canisters/user/impl/src/timer_job_types.rs b/backend/canisters/user/impl/src/timer_job_types.rs index 166568392e..6c0a6ba359 100644 --- a/backend/canisters/user/impl/src/timer_job_types.rs +++ b/backend/canisters/user/impl/src/timer_job_types.rs @@ -389,6 +389,9 @@ impl Job for SendMessageToChannelJob { impl Job for MarkVideoCallEndedJob { fn execute(self) { - mutate_state(|state| end_video_call_impl(self.0, state)); + let response = mutate_state(|state| end_video_call_impl(self.0.clone(), state)); + if !matches!(response, user_canister::end_video_call::Response::Success) { + error!(?response, args = ?self.0, "Failed to mark video call ended"); + } } }