skip projects with no issues

This commit is contained in:
Jai A 2025-01-08 22:19:04 -08:00
parent 8e754cfeb5
commit 0409fcec2f
No known key found for this signature in database
GPG Key ID: 9A9F9B7250E9883C

View File

@ -20,6 +20,7 @@ use sqlx::PgPool;
use std::collections::HashMap;
use std::net::Ipv4Addr;
use std::sync::Arc;
use log::info;
pub fn config(cfg: &mut web::ServiceConfig) {
cfg.service(
@ -197,6 +198,11 @@ pub async fn delphi_result_ingest(
redis: web::Data<RedisPool>,
body: web::Json<DelphiIngest>,
) -> Result<HttpResponse, ApiError> {
if body.issues.is_empty() {
info!("No issues found for file {}", body.url);
return Ok(HttpResponse::NoContent().finish());
}
let webhook_url = dotenvy::var("DELPHI_SLACK_WEBHOOK")?;
let project = crate::database::models::Project::get_id(