Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add healthcheck endpoint #266

Merged
merged 3 commits into from
Oct 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading