From 0987c299037db1d896b7bd21496041c0b0dd1981 Mon Sep 17 00:00:00 2001 From: Jiang Bian Date: Mon, 11 Nov 2013 08:07:57 -0600 Subject: [PATCH] load balancing rules update --- tweetf0rm/scheduler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tweetf0rm/scheduler.py b/tweetf0rm/scheduler.py index 3c00627..a92f520 100644 --- a/tweetf0rm/scheduler.py +++ b/tweetf0rm/scheduler.py @@ -139,9 +139,9 @@ def balancing_load(self): logger.info("load balancing process started...") cmds = [] controls = [] - for i in range(int(0.3 * min_qsize)): + for i in range(int(0.3 * (max_qsize - min_qsize))): cmd = self.crawlers[max_crawler_id]['crawler_queue'].get() - if (cmd in control_cmds): + if (cmd['cmd'] in control_cmds): controls.append(cmd) else: cmds.append(cmd)