mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
makes the analytics available for all the routes
This commit is contained in:
parent
664d09e86a
commit
d72c887422
6 changed files with 69 additions and 21 deletions
|
@ -56,17 +56,22 @@ async fn main() -> anyhow::Result<()> {
|
|||
|
||||
print_launch_resume(&opt, analytics);
|
||||
|
||||
run_http(meilisearch, opt).await?;
|
||||
run_http(meilisearch, opt, analytics).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn run_http(data: MeiliSearch, opt: Opt) -> anyhow::Result<()> {
|
||||
async fn run_http(
|
||||
data: MeiliSearch,
|
||||
opt: Opt,
|
||||
analytics: &'static dyn Analytics,
|
||||
) -> anyhow::Result<()> {
|
||||
let _enable_dashboard = &opt.env == "development";
|
||||
let opt_clone = opt.clone();
|
||||
let http_server = HttpServer::new(move || create_app!(data, _enable_dashboard, opt_clone))
|
||||
// Disable signals allows the server to terminate immediately when a user enter CTRL-C
|
||||
.disable_signals();
|
||||
let http_server =
|
||||
HttpServer::new(move || create_app!(data, _enable_dashboard, opt_clone, analytics))
|
||||
// Disable signals allows the server to terminate immediately when a user enter CTRL-C
|
||||
.disable_signals();
|
||||
|
||||
if let Some(config) = opt.get_ssl_config()? {
|
||||
http_server
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue