Fix guaranteed deadlock when refreshing token during webhook handling
continuous-integration/drone the build was successful
Details
continuous-integration/drone the build was successful
Details
This commit is contained in:
parent
eef55632bb
commit
e8fcd33a01
|
@ -177,6 +177,8 @@ async fn monzo_hook(hook: MonzoHook, state: State) -> anyhow::Result<impl warp::
|
||||||
.unwrap_or("unk");
|
.unwrap_or("unk");
|
||||||
|
|
||||||
buf.push_str(&format!(" on {}", on_account_name));
|
buf.push_str(&format!(" on {}", on_account_name));
|
||||||
|
// MUST drop state_inner to avoid deadlock
|
||||||
|
drop(state_inner);
|
||||||
if let Some(monzo_client) = monzo_client_freshened(&state).await? {
|
if let Some(monzo_client) = monzo_client_freshened(&state).await? {
|
||||||
// include new balance
|
// include new balance
|
||||||
match monzo_client.balance(&txn_created.account_id).await {
|
match monzo_client.balance(&txn_created.account_id).await {
|
||||||
|
|
Loading…
Reference in New Issue