From b28d12facae5648cb4fe7323b4c961532da38b69 Mon Sep 17 00:00:00 2001
From: ale <ale@incal.net>
Date: Sun, 30 Oct 2011 18:16:50 +0000
Subject: [PATCH] print the bandwidth limit when setting it

---
 client/djrandom_client/client.py   | 2 +-
 client/djrandom_client/throttle.py | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/client/djrandom_client/client.py b/client/djrandom_client/client.py
index 9523017..db66af3 100644
--- a/client/djrandom_client/client.py
+++ b/client/djrandom_client/client.py
@@ -53,7 +53,7 @@ class FullScan(threading.Thread):
 
 def run_client(server_url, music_dir, api_key, run_once, bwlimit, enable_watcher):
     if bwlimit:
-        throttle.set_rate_limit(bwlimit)
+        throttle.set_rate_limit(int(bwlimit))
 
     # Warn on this condition, but don't die -- the directory might exist later!
     if not os.path.isdir(music_dir):
diff --git a/client/djrandom_client/throttle.py b/client/djrandom_client/throttle.py
index f67b61b..78f0fb7 100644
--- a/client/djrandom_client/throttle.py
+++ b/client/djrandom_client/throttle.py
@@ -58,6 +58,7 @@ _bucket = None
 
 def set_rate_limit(kbps):
     global _bucket
+    log.info('setting upload bandwidth limit to %d KB/s' % kbps)
     bps = 1024 * kbps
     _bucket = TokenBucket(2 * bps, bps)
 
-- 
GitLab