server: pull: fix sync info message for root namespace

The root namespace is displayed as empty string when used in the
format string. Distinguish and explicitly write out the root namespace
in the sync info message shown in the sync jobs task log.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
This commit is contained in:
Christian Ebner 2024-07-15 12:15:43 +02:00 committed by Thomas Lamprecht
parent c7275ede6d
commit b5b0b87eef

View File

@ -1311,8 +1311,14 @@ pub(crate) async fn pull_store(mut params: PullParameters) -> Result<PullStats,
if params.max_depth != Some(0) {
groups += ns_progress.done_groups;
snapshots += ns_progress.done_snapshots;
let ns = if namespace.is_root() {
"root namespace".into()
} else {
format!("namespace {namespace}")
};
info!(
"Finished syncing namespace {namespace}, current progress: {groups} groups, {snapshots} snapshots"
"Finished syncing {ns}, current progress: {groups} groups, {snapshots} snapshots"
);
}
}