fix: drop Mutex before calling tx_approve.send() (#2876)
This commit is contained in:
@@ -657,9 +657,17 @@ impl Session {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn notify_approval(&self, sub_id: &str, decision: ReviewDecision) {
|
pub fn notify_approval(&self, sub_id: &str, decision: ReviewDecision) {
|
||||||
let mut state = self.state.lock_unchecked();
|
let entry = {
|
||||||
if let Some(tx_approve) = state.pending_approvals.remove(sub_id) {
|
let mut state = self.state.lock_unchecked();
|
||||||
tx_approve.send(decision).ok();
|
state.pending_approvals.remove(sub_id)
|
||||||
|
};
|
||||||
|
match entry {
|
||||||
|
Some(tx_approve) => {
|
||||||
|
tx_approve.send(decision).ok();
|
||||||
|
}
|
||||||
|
None => {
|
||||||
|
warn!("No pending approval found for sub_id: {sub_id}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user