expose revision in the stats method

This commit is contained in:
Nikita Sivukhin
2025-09-15 10:56:13 +04:00
parent ebf042cf6b
commit 527d0cb1f3
4 changed files with 21 additions and 13 deletions

View File

@@ -45,6 +45,7 @@ pub enum GeneratorResponse {
revert_wal: i64,
last_pull_unix_time: i64,
last_push_unix_time: Option<i64>,
revision: Option<String>,
},
}

View File

@@ -269,13 +269,14 @@ impl SyncEngine {
self.run(async move |coro, sync_engine| {
let sync_engine = try_read(sync_engine)?;
let sync_engine = try_unwrap(&sync_engine)?;
let changes = sync_engine.stats(coro).await?;
let stats = sync_engine.stats(coro).await?;
Ok(Some(GeneratorResponse::SyncEngineStats {
operations: changes.cdc_operations,
main_wal: changes.main_wal_size as i64,
revert_wal: changes.revert_wal_size as i64,
last_pull_unix_time: changes.last_pull_unix_time,
last_push_unix_time: changes.last_push_unix_time,
operations: stats.cdc_operations,
main_wal: stats.main_wal_size as i64,
revert_wal: stats.revert_wal_size as i64,
last_pull_unix_time: stats.last_pull_unix_time,
last_push_unix_time: stats.last_push_unix_time,
revision: stats.revision,
}))
})
}