From f5221bb03c31a25592c12843091099c8bf121566 Mon Sep 17 00:00:00 2001 From: WeebDataHoarder <57538841+WeebDataHoarder@users.noreply.github.com> Date: Sun, 6 Feb 2022 18:13:31 +0100 Subject: [PATCH] Add % on badger import state --- store/cli/cli.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/store/cli/cli.go b/store/cli/cli.go index bef8046..217401d 100644 --- a/store/cli/cli.go +++ b/store/cli/cli.go @@ -60,6 +60,18 @@ func main() { taskState := source.ConvertToBadger(destination, *split) + for { + p, t := taskState.Progress() + + log.Printf("%.03f%% %d/%d", float64(p*100)/float64(t), p, t) + + if p >= t { + break + } + + time.Sleep(time.Second * 5) + } + taskState.Wait() } else if *command == "bptree" { source, err := store.NewAppendConverter(*sourcePath, true, true)