mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-30 00:55:00 +08:00
disable amplitude on debug build
This commit is contained in:
parent
c0d169e79e
commit
4e2568fd6e
@ -6,7 +6,7 @@ mod index_controller;
|
|||||||
pub mod option;
|
pub mod option;
|
||||||
pub mod routes;
|
pub mod routes;
|
||||||
|
|
||||||
#[cfg(feature = "analytics")]
|
#[cfg(all(not(debug_assertions), feature = "analytics"))]
|
||||||
pub mod analytics;
|
pub mod analytics;
|
||||||
|
|
||||||
pub use self::data::Data;
|
pub use self::data::Data;
|
||||||
|
@ -5,7 +5,7 @@ use main_error::MainError;
|
|||||||
use meilisearch_http::{create_app, Data, Opt};
|
use meilisearch_http::{create_app, Data, Opt};
|
||||||
use structopt::StructOpt;
|
use structopt::StructOpt;
|
||||||
|
|
||||||
#[cfg(feature = "analytics")]
|
#[cfg(all(not(debug_assertions), feature = "analytics"))]
|
||||||
use meilisearch_http::analytics;
|
use meilisearch_http::analytics;
|
||||||
|
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
@ -57,7 +57,7 @@ async fn main() -> Result<(), MainError> {
|
|||||||
|
|
||||||
let data = Data::new(opt.clone())?;
|
let data = Data::new(opt.clone())?;
|
||||||
|
|
||||||
#[cfg(feature = "analytics")]
|
#[cfg(all(not(debug_assertions), feature = "analytics"))]
|
||||||
if !opt.no_analytics {
|
if !opt.no_analytics {
|
||||||
let analytics_data = data.clone();
|
let analytics_data = data.clone();
|
||||||
let analytics_opt = opt.clone();
|
let analytics_opt = opt.clone();
|
||||||
@ -121,7 +121,7 @@ pub fn print_launch_resume(opt: &Opt, data: &Data) {
|
|||||||
env!("CARGO_PKG_VERSION").to_string()
|
env!("CARGO_PKG_VERSION").to_string()
|
||||||
);
|
);
|
||||||
|
|
||||||
#[cfg(feature = "analytics")]
|
#[cfg(all(not(debug_assertions), feature = "analytics"))]
|
||||||
{
|
{
|
||||||
if opt.no_analytics {
|
if opt.no_analytics {
|
||||||
eprintln!("Anonymous telemetry:\t\"Disabled\"");
|
eprintln!("Anonymous telemetry:\t\"Disabled\"");
|
||||||
|
@ -104,7 +104,7 @@ pub struct Opt {
|
|||||||
pub env: String,
|
pub env: String,
|
||||||
|
|
||||||
/// Do not send analytics to Meili.
|
/// Do not send analytics to Meili.
|
||||||
#[cfg(feature = "analytics")]
|
#[cfg(all(not(debug_assertions), feature = "analytics"))]
|
||||||
#[structopt(long, env = "MEILI_NO_ANALYTICS")]
|
#[structopt(long, env = "MEILI_NO_ANALYTICS")]
|
||||||
pub no_analytics: bool,
|
pub no_analytics: bool,
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ pub fn default_settings(dir: impl AsRef<Path>) -> Opt {
|
|||||||
http_addr: "127.0.0.1:7700".to_owned(),
|
http_addr: "127.0.0.1:7700".to_owned(),
|
||||||
master_key: None,
|
master_key: None,
|
||||||
env: "development".to_owned(),
|
env: "development".to_owned(),
|
||||||
#[cfg(feature = "analytics")]
|
#[cfg(all(not(debug_assertions), feature = "analytics"))]
|
||||||
no_analytics: true,
|
no_analytics: true,
|
||||||
max_mdb_size: Byte::from_unit(4.0, ByteUnit::GiB).unwrap(),
|
max_mdb_size: Byte::from_unit(4.0, ByteUnit::GiB).unwrap(),
|
||||||
max_udb_size: Byte::from_unit(4.0, ByteUnit::GiB).unwrap(),
|
max_udb_size: Byte::from_unit(4.0, ByteUnit::GiB).unwrap(),
|
||||||
|
Loading…
Reference in New Issue
Block a user