diff --git a/client/djrandom_client/client.py b/client/djrandom_client/client.py index 9523017d3a952d310dac7888fec30ca3ef45534e..db66af34c9fc2acf739aa48b4dd33194d04d0bdf 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 f67b61ba1347ab7eaf34cb2b13f08e0096c826c5..78f0fb7e29aff948af69003dcad09dc378e2e047 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)