Add webhook already handled check
ci/woodpecker/push/tests Pipeline failed
ci/woodpecker/pr/tests Pipeline failed

Fix all tests
Add woodpecker ci (tests + release)
This commit is contained in:
2026-06-12 19:56:32 +00:00
parent 3c32cd20b6
commit 433021d607
13 changed files with 221 additions and 17 deletions
+9 -4
View File
@@ -58,10 +58,15 @@ async fn webhook(
) -> Result<impl IntoResponse, AppError> {
tracing::Span::current().record("webhook_type", tracing::field::debug(&wb));
app_state
.bot_tx
.try_send(wb)
.map_err(|_| AppError::ChannelFullErr)?;
let event_id = wb.event_id();
if app_state.bot.check_and_mark(event_id).await {
return Err(AppError::AlreadyProcessedErr);
}
if app_state.bot_tx.try_send(wb).is_err() {
app_state.bot.unmark(event_id).await;
return Err(AppError::ChannelFullErr);
}
Ok((StatusCode::CREATED, "Task started"))
}