feat: enhance desktop application startup diagnostics and logging

- Introduced a new `startup` module to capture and manage startup diagnostics.
- Implemented logging functionality with daily rotation and error reporting for application startup failures.
- Updated the main application run function to return an exit code based on startup success or failure.
- Added new dependencies for logging and diagnostics in `Cargo.toml`.
- Increased request timeout in the control service for improved stability.
- Expanded maximum search results in the federation module for better search capabilities.
This commit is contained in:
leookun
2026-08-30 03:19:01 +08:00
parent 44e2d8057a
commit fd7998e43c
24 changed files with 295 additions and 32 deletions
+1 -1
View File
@@ -169,7 +169,7 @@ impl ControlService {
.header(OS_HEADER, std::env::consts::OS)
.header(APP_VERSION_HEADER, env!("CARGO_PKG_VERSION"))
.header(LANGUAGE_HEADER, language)
.timeout(std::time::Duration::from_secs(5));
.timeout(std::time::Duration::from_secs(60));
if let Some(disabled_ad_ids) = disabled_ad_ids.filter(|value| !value.is_empty()) {
request = request.header(DISABLED_AD_IDS_HEADER, disabled_ad_ids);
}
+1 -1
View File
@@ -8,7 +8,7 @@ use crate::store::Store;
use super::{catalog, SearchEngine, SearchHit};
const RRF_K: f64 = 60.0;
const MAX_RESULTS: usize = 10;
const MAX_RESULTS: usize = 30;
#[derive(Clone)]
pub struct WebSearch {
+2
View File
@@ -28,7 +28,9 @@ impl Store {
.max_connections(8)
.connect_with(options)
.await?;
tracing::info!("running database migrations");
sqlx::migrate!("./migrations").run(&pool).await?;
tracing::info!("database migrations completed");
Ok(Self {
pool,
writes: WriteCoordinator::default(),