feat: change async-bb8 fork and tokio spawn for concurrent database calls (#2774)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: akshay-97 <adiosphobian@gmail.com>
Co-authored-by: akshay.s <akshay.s@juspay.in>
Co-authored-by: Kartikeya Hegde <karthikey.hegde@juspay.in>
This commit is contained in:
Arun Raj M
2023-11-16 10:27:34 +05:30
committed by GitHub
parent 496245d990
commit d634fdeac3
69 changed files with 1516 additions and 721 deletions

View File

@ -39,7 +39,7 @@ pub async fn files_create(
Ok(valid_request) => valid_request,
Err(err) => return api::log_and_return_error_response(err),
};
api::server_wrap(
Box::pin(api::server_wrap(
flow,
state,
&req,
@ -47,7 +47,7 @@ pub async fn files_create(
|state, auth, req| files_create_core(state, auth.merchant_account, auth.key_store, req),
auth::auth_type(&auth::ApiKeyAuth, &auth::JWTAuth, req.headers()),
api_locking::LockAction::NotApplicable,
)
))
.await
}
/// Files - Delete
@ -77,7 +77,7 @@ pub async fn files_delete(
let file_id = files::FileId {
file_id: path.into_inner(),
};
api::server_wrap(
Box::pin(api::server_wrap(
flow,
state,
&req,
@ -85,7 +85,7 @@ pub async fn files_delete(
|state, auth, req| files_delete_core(state, auth.merchant_account, req),
auth::auth_type(&auth::ApiKeyAuth, &auth::JWTAuth, req.headers()),
api_locking::LockAction::NotApplicable,
)
))
.await
}
/// Files - Retrieve
@ -115,7 +115,7 @@ pub async fn files_retrieve(
let file_id = files::FileId {
file_id: path.into_inner(),
};
api::server_wrap(
Box::pin(api::server_wrap(
flow,
state,
&req,
@ -123,6 +123,6 @@ pub async fn files_retrieve(
|state, auth, req| files_retrieve_core(state, auth.merchant_account, auth.key_store, req),
auth::auth_type(&auth::ApiKeyAuth, &auth::JWTAuth, req.headers()),
api_locking::LockAction::NotApplicable,
)
))
.await
}