fix: reconcile ambiguous Stripe event ordering
Some checks failed
CI / verify (push) Has been cancelled
Some checks failed
CI / verify (push) Has been cancelled
This commit is contained in:
@@ -44,7 +44,7 @@ pub async fn run(state: AppState) -> Result<(), AppError> {
|
||||
.nest("/api/v1", v1)
|
||||
.fallback_service(static_service)
|
||||
.layer(axum::middleware::from_fn(request_context::middleware))
|
||||
.with_state(state);
|
||||
.with_state(state.clone());
|
||||
|
||||
let listener = tokio::net::TcpListener::bind(&addr)
|
||||
.await
|
||||
@@ -52,12 +52,15 @@ pub async fn run(state: AppState) -> Result<(), AppError> {
|
||||
|
||||
tracing::info!(addr = %addr, "API server listening");
|
||||
|
||||
axum::serve(
|
||||
let reconciliation_task = tokio::spawn(webhooks::reconciliation_loop(state.clone()));
|
||||
let serve_result = axum::serve(
|
||||
listener,
|
||||
app.into_make_service_with_connect_info::<SocketAddr>(),
|
||||
)
|
||||
.await
|
||||
.map_err(|err| AppError::new(ErrorCode::Internal, "HTTP 服务异常退出").with_source(err))
|
||||
.await;
|
||||
reconciliation_task.abort();
|
||||
serve_result
|
||||
.map_err(|err| AppError::new(ErrorCode::Internal, "HTTP 服务异常退出").with_source(err))
|
||||
}
|
||||
|
||||
fn v1_router() -> Router<AppState> {
|
||||
|
||||
1221
src/api/webhooks.rs
1221
src/api/webhooks.rs
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user