]> git.0d.be Git - git-acab.git/commitdiff
rate limit progress messages main
authorFrédéric Péters <fpeters@0d.be>
Mon, 6 Sep 2021 13:19:20 +0000 (15:19 +0200)
committerFrédéric Péters <fpeters@0d.be>
Mon, 6 Sep 2021 13:21:21 +0000 (15:21 +0200)
git-acab

index 9645ac2ae8cf3f7c49fdda9a90d51e7a537a09f0..4cd98394090534b56a51ee0488af1940f2d89ece 100755 (executable)
--- a/git-acab
+++ b/git-acab
@@ -30,11 +30,13 @@ def amend_commit(start_timestamp):
     )
     authored_timestamp = start_timestamp
     base_env = os.environ
     )
     authored_timestamp = start_timestamp
     base_env = os.environ
+    last_print = 0
     while True:
         authored_timestamp -= 1
         for committed_timestamp in range(start_timestamp, authored_timestamp, -1):
             counter += 1
     while True:
         authored_timestamp -= 1
         for committed_timestamp in range(start_timestamp, authored_timestamp, -1):
             counter += 1
-            if not args.quiet:
+            if not args.quiet and time.time() - last_print > 0.05:
+                last_print = time.time()
                 print(
                     '%5d - %s - %s - [%s:%02d]'
                     % (
                 print(
                     '%5d - %s - %s - [%s:%02d]'
                     % (