Skip to content

Commit e1810e3

Browse files
committed
fix
1 parent e8f33fd commit e1810e3

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

prover/src/rpc.rs

+16-12
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,14 @@ where
6565
[(); S::SYNC_COMMITTEE_DEPTH]:,
6666
[(); S::FINALIZED_HEADER_INDEX]:,
6767
{
68-
if let Err(e) = state.concurrency.clone().acquire_owned().await {
69-
return Err(JsonRpcError::internal(format!(
70-
"Failed to acquire concurrency lock: {}",
71-
e
72-
)));
73-
};
68+
let _permit = state
69+
.concurrency
70+
.clone()
71+
.acquire_owned()
72+
.await
73+
.map_err(|e| {
74+
JsonRpcError::internal(format!("Failed to acquire concurrency lock: {}", e))
75+
})?;
7476

7577
let GenProofCommitteeUpdateParams {
7678
light_client_update,
@@ -119,12 +121,14 @@ where
119121
[(); S::BYTES_PER_LOGS_BLOOM]:,
120122
[(); S::MAX_EXTRA_DATA_BYTES]:,
121123
{
122-
if let Err(e) = state.concurrency.clone().acquire_owned().await {
123-
return Err(JsonRpcError::internal(format!(
124-
"Failed to acquire concurrency lock: {}",
125-
e
126-
)));
127-
};
124+
let _permit = state
125+
.concurrency
126+
.clone()
127+
.acquire_owned()
128+
.await
129+
.map_err(|e| {
130+
JsonRpcError::internal(format!("Failed to acquire concurrency lock: {}", e))
131+
})?;
128132

129133
let GenProofStepParams {
130134
light_client_finality_update,

0 commit comments

Comments
 (0)