Skip to content

Commit

Permalink
Merge pull request #266 from arkedge/add-healthcheck
Browse files Browse the repository at this point in the history
Add healthcheck endpoint
  • Loading branch information
sksat authored Oct 30, 2024
2 parents 81d1c0d + a55bfa3 commit df85eec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ async fn main() -> std::io::Result<()> {
.app_data(web::Data::new(Arc::new(cfg.clone()))) // memo: https://github.com/actix/actix-web/issues/1454#issuecomment-867897725
.app_data(web::Data::new(Arc::new(opt.clone())))
.service(web::resource("/webhook").route(web::post().to(webhook)))
.service(web::resource("/healthcheck").route(web::get().to(HttpResponse::Ok)))
})
.bind(format!("0.0.0.0:{}", port))?
.run()
Expand Down Expand Up @@ -245,7 +246,9 @@ impl Rule {
let include_query_result = Rule::match_results(&self.query, payload).iter().all(|&r| r);

if let Some(exclude_query) = &self.exclude_query {
let exclude_query_result = Rule::match_results(exclude_query, payload).iter().any(|&r| r);
let exclude_query_result = Rule::match_results(exclude_query, payload)
.iter()
.any(|&r| r);
include_query_result && !exclude_query_result
} else {
include_query_result
Expand Down

0 comments on commit df85eec

Please sign in to comment.