fix: reconcile ambiguous Stripe event ordering
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
237899745
2026-07-26 03:08:23 +08:00
parent 08000cc16e
commit 326a678249
6 changed files with 1081 additions and 262 deletions

View File

@@ -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> {

File diff suppressed because it is too large Load Diff