stop logging the no space left on device error

This commit is contained in:
Tamo 2021-06-28 13:23:13 +02:00
parent d7ca68d8e9
commit d74c698adc
No known key found for this signature in database
GPG Key ID: 20CD8020AFA88D69

View File

@ -7,6 +7,8 @@ use structopt::StructOpt;
#[cfg(all(not(debug_assertions), feature = "analytics"))] #[cfg(all(not(debug_assertions), feature = "analytics"))]
use meilisearch_http::analytics; use meilisearch_http::analytics;
#[cfg(all(not(debug_assertions), feature = "analytics"))]
use std::sync::Arc;
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
#[global_allocator] #[global_allocator]
@ -46,6 +48,14 @@ async fn main() -> Result<(), MainError> {
let sentry = sentry::init(sentry::ClientOptions { let sentry = sentry::init(sentry::ClientOptions {
release: sentry::release_name!(), release: sentry::release_name!(),
dsn: Some(SENTRY_DSN.parse()?), dsn: Some(SENTRY_DSN.parse()?),
before_send: Some(Arc::new(|event| {
event
.message
.as_ref()
.map(|msg| msg.to_lowercase().contains("no space left on device"))
.unwrap_or(false)
.then(|| event)
})),
..Default::default() ..Default::default()
}); });
// sentry must stay alive as long as possible // sentry must stay alive as long as possible