mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-06-16 04:48:47 +02:00
Make clippy happy
This commit is contained in:
parent
38b317857d
commit
90d96ee415
@ -132,13 +132,12 @@ async fn try_main() -> anyhow::Result<()> {
|
|||||||
let (index_scheduler, auth_controller) = setup_meilisearch(&opt)?;
|
let (index_scheduler, auth_controller) = setup_meilisearch(&opt)?;
|
||||||
|
|
||||||
// We ask users their emails just after the data.ms is created
|
// We ask users their emails just after the data.ms is created
|
||||||
let skip_email_path = MEILISEARCH_CONFIG_PATH.as_ref().map(|conf| conf.join(SKIP_EMAIL_FILENAME));
|
let skip_email_path =
|
||||||
|
MEILISEARCH_CONFIG_PATH.as_ref().map(|conf| conf.join(SKIP_EMAIL_FILENAME));
|
||||||
// If the config path does not exist, it means the user don't have a home directory
|
// If the config path does not exist, it means the user don't have a home directory
|
||||||
let skip_email = skip_email_path.as_ref().map_or(true, |path| path.exists());
|
let skip_email = skip_email_path.as_ref().is_none_or(|path| path.exists());
|
||||||
opt.contact_email = match opt.contact_email.as_ref().map(|email| email.as_deref()) {
|
opt.contact_email = match opt.contact_email.as_ref().map(|email| email.as_deref()) {
|
||||||
Some(Some("false")) | None if !skip_email => {
|
Some(Some("false")) | None if !skip_email => prompt_for_contact_email().await.map(Some)?,
|
||||||
prompt_for_contact_email().await.map(Some)?
|
|
||||||
}
|
|
||||||
Some(Some(email)) if !skip_email => Some(Some(email.to_string())),
|
Some(Some(email)) if !skip_email => Some(Some(email.to_string())),
|
||||||
_otherwise => None,
|
_otherwise => None,
|
||||||
};
|
};
|
||||||
@ -147,7 +146,7 @@ async fn try_main() -> anyhow::Result<()> {
|
|||||||
let email = email.clone();
|
let email = email.clone();
|
||||||
// We spawn a task to register the email and create the skip email
|
// We spawn a task to register the email and create the skip email
|
||||||
// file to avoid blocking the Meilisearch launch further.
|
// file to avoid blocking the Meilisearch launch further.
|
||||||
let _ = tokio::spawn(async move {
|
let handle = tokio::spawn(async move {
|
||||||
if let Some(skip_email_path) = skip_email_path {
|
if let Some(skip_email_path) = skip_email_path {
|
||||||
// If the analytics are disabled the directory might not exist at all
|
// If the analytics are disabled the directory might not exist at all
|
||||||
if let Err(e) = tokio::fs::create_dir_all(skip_email_path.parent().unwrap()).await {
|
if let Err(e) = tokio::fs::create_dir_all(skip_email_path.parent().unwrap()).await {
|
||||||
@ -161,6 +160,7 @@ async fn try_main() -> anyhow::Result<()> {
|
|||||||
eprintln!("Failed to register email: {}", err);
|
eprintln!("Failed to register email: {}", err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
drop(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
let analytics =
|
let analytics =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user