Skip to content
Snippets Groups Projects
Commit b28d12fa authored by ale's avatar ale
Browse files

print the bandwidth limit when setting it

parent 1aba9837
Branches
No related tags found
No related merge requests found
...@@ -53,7 +53,7 @@ class FullScan(threading.Thread): ...@@ -53,7 +53,7 @@ class FullScan(threading.Thread):
def run_client(server_url, music_dir, api_key, run_once, bwlimit, enable_watcher): def run_client(server_url, music_dir, api_key, run_once, bwlimit, enable_watcher):
if bwlimit: 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! # Warn on this condition, but don't die -- the directory might exist later!
if not os.path.isdir(music_dir): if not os.path.isdir(music_dir):
......
...@@ -58,6 +58,7 @@ _bucket = None ...@@ -58,6 +58,7 @@ _bucket = None
def set_rate_limit(kbps): def set_rate_limit(kbps):
global _bucket global _bucket
log.info('setting upload bandwidth limit to %d KB/s' % kbps)
bps = 1024 * kbps bps = 1024 * kbps
_bucket = TokenBucket(2 * bps, bps) _bucket = TokenBucket(2 * bps, bps)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment