mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 02:27:40 +08:00
Merge #284
284: [http-ui] Introduce the route `die` r=Kerollmops a=irevoire This route just `exit` the process. This can come in handy when you run `http-ui` inside of another process (a profiler for example), and you don't want to kill everything Co-authored-by: Tamo <tamo@meilisearch.com> Co-authored-by: Irevoire <tamo@meilisearch.com>
This commit is contained in:
commit
63db43cc7a
@ -982,6 +982,13 @@ async fn main() -> anyhow::Result<()> {
|
||||
})
|
||||
});
|
||||
|
||||
let die_route = warp::filters::method::get().and(warp::path!("die")).map(move || {
|
||||
eprintln!("Killed by an HTTP request received on the die route");
|
||||
std::process::exit(0);
|
||||
#[allow(unreachable_code)]
|
||||
warp::reply()
|
||||
});
|
||||
|
||||
let routes = dash_html_route
|
||||
.or(updates_list_or_html_route)
|
||||
.or(dash_bulma_route)
|
||||
@ -1001,7 +1008,8 @@ async fn main() -> anyhow::Result<()> {
|
||||
.or(clearing_route)
|
||||
.or(change_settings_route)
|
||||
.or(change_facet_levels_route)
|
||||
.or(update_ws_route);
|
||||
.or(update_ws_route)
|
||||
.or(die_route);
|
||||
|
||||
let addr = SocketAddr::from_str(&opt.http_listen_addr)?;
|
||||
warp::serve(routes).run(addr).await;
|
||||
|
Loading…
Reference in New Issue
Block a user