Fix sentry http request info

Add async bot running with semaphore
This commit is contained in:
2026-06-10 17:50:24 +00:00
parent efb35d5a8a
commit a2d898c07d
7 changed files with 66 additions and 17 deletions
+6 -7
View File
@@ -24,20 +24,21 @@ fn main() -> anyhow::Result<()> {
)
.init();
if let Ok(sentry_dsn) = env::try_get_env("SENTRY_DSN") {
let _sentry_guard = if let Ok(sentry_dsn) = env::try_get_env("SENTRY_DSN") {
info!("Initialize sentry");
let _guard = sentry::init((
Some(sentry::init((
sentry_dsn,
sentry::ClientOptions {
release: sentry::release_name!(),
send_default_pii: true,
..Default::default()
},
));
)))
} else {
warn!("SENTRY_DSN not set, sentry will not be initialized");
}
None
};
tokio::runtime::Runtime::new()?.block_on(run())
}
@@ -54,9 +55,7 @@ async fn run() -> anyhow::Result<()> {
);
let bot = Bot::new(config.clone())?;
let (tx, rx) = tokio::sync::mpsc::channel::<WebhookType>(1);
let (tx, rx) = tokio::sync::mpsc::channel::<WebhookType>(config.bot_max_concurrent * 2);
let app_state = AppState { bot_tx: tx, config };
tokio::try_join!(bot.start(rx), api::start(app_state))?;