def run(self):
while True:
if self.scan_config.RESTART:
self.scan_config.RESTART = False
if self.scan_config.ACCOUNTS_CHANGED:
self.scan_config.ACCOUNTS_CHANGED = False
num_workers = min(max(int(math.ceil(len(config['ACCOUNTS']) / 23.0)), 3), 10)
self.api.resize_workers(num_workers)
self.api.add_accounts(config['ACCOUNTS'])
ScanMetrics.NUM_THREADS = num_workers
ScanMetrics.NUM_ACCOUNTS = len(config['ACCOUNTS'])
if (not self.scan_config.SCAN_LOCATIONS or
not config.get('ACCOUNTS', None)):
time.sleep(5)
continue
ScanMetrics.STEPS_COMPLETED = 0
scan_start_time = time.time()
self.scan()
ScanMetrics.COMPLETE_SCAN_TIME = time.time() - scan_start_time
评论列表
文章目录