[Groonga-commit] droonga/droonga-engine at 243fb88 [master] Show progress of "no-remote" version same as remote one

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Nov 21 21:22:24 JST 2014


YUKI Hiroshi	2014-11-21 21:22:24 +0900 (Fri, 21 Nov 2014)

  New Revision: 243fb8845fa26a09b8d4cabef841e45ae760dc1b
  https://github.com/droonga/droonga-engine/commit/243fb8845fa26a09b8d4cabef841e45ae760dc1b

  Message:
    Show progress of "no-remote" version same as remote one

  Modified files:
    bin/droonga-engine-absorb-data

  Modified: bin/droonga-engine-absorb-data (+6 -2)
===================================================================
--- bin/droonga-engine-absorb-data    2014-11-21 21:19:44 +0900 (3ba7805)
+++ bin/droonga-engine-absorb-data    2014-11-21 21:22:24 +0900 (de71e19)
@@ -146,12 +146,16 @@ if options.remote
                                   "value" => timestamp)
   end
 else
+  last_progress = ""
   absorber.absorb do |live_status|
     if live_status[:progress]
-      puts live_status[:progress]
+      progress = live_status[:progress]
     else
-      puts live_status[:output]
+      progress = live_status[:output]
     end
+    printf("%s", "#{" " * last_progress.size}\r")
+    printf("%s", "#{progress}\r")
+    last_progress = progress
   end
   response = run_remote_command(source_node, "report_status",
                                 "node" => source_node,
-------------- next part --------------
HTML����������������������������...
下載 



More information about the Groonga-commit mailing list
Back to archive index