while True: time.sleep(60) num_deleted = cleanup_cache() log.info( "Cleaned up {} entries from encounter cache.".format(num_deleted)) # =========================================================================== log.info("PGScout starting up.") with open(cfg_get('accounts_file'), 'r') as f: for num, line in enumerate(f, 1): fields = line.split(",") fields = map(str.strip, fields) scout = Scout(fields[0], fields[1], fields[2], jobs) scouts.append(scout) t = Thread(target=scout.run, name="{}".format(scout.username)) t.daemon = True t.start() # Cleanup cache in background t = Thread(target=cache_cleanup_thread, name="cache_cleaner") t.daemon = True t.start() # Start thread to print current status and get user input. t = Thread(target=print_status, name='status_printer', args=(scouts, 'logs', jobs)) t.daemon = True
def init_scout(self, acc_data): return Scout(acc_data['auth_service'], acc_data['username'], acc_data['password'], self.job_queue)
hash_keys = init_resoures_from_file('hash keys', 'hash_key_file') if hash_keys and len(hash_keys) > 0: for hk in hash_keys: hash_key_provider.add_resource(hk) log.info("Loaded {} hash keys from file {}.".format( len(hash_keys), cfg_get('hash_key_file'))) proxy_provider = CyclicResourceProvider() for proxy in get_proxies(): proxy_provider.add_resource(proxy) with open(cfg_get('accounts_file'), 'r') as f: for num, line in enumerate(f, 1): fields = line.split(",") fields = map(str.strip, fields) scout = Scout(fields[0], fields[1], fields[2], jobs, hash_key_provider, proxy_provider) scouts.append(scout) t = Thread(target=scout.run, name="{}".format(scout.username)) t.daemon = True t.start() # Cleanup cache in background t = Thread(target=cache_cleanup_thread, name="cache_cleaner") t.daemon = True t.start() # Start thread to print current status and get user input. t = Thread(target=print_status, name='status_printer', args=(scouts, 'logs', jobs)) t.daemon = True
"Cleaned up {} entries from encounter cache.".format(num_deleted)) # =========================================================================== log.info("PGScout starting up.") init_mr_mime() init_proxies() with open(cfg_get('accounts_file'), 'r') as f: for num, line in enumerate(f, 1): fields = line.split(",") fields = map(str.strip, fields) scout = Scout(fields[0], fields[1], fields[2], jobs, cfg_get('hash_key'), get_new_proxy()) scouts.append(scout) t = Thread(target=scout.run, name="{}".format(scout.username)) t.daemon = True t.start() # Cleanup cache in background t = Thread(target=cache_cleanup_thread, name="cache_cleaner") t.daemon = True t.start() # Start thread to print current status and get user input. t = Thread(target=print_status, name='status_printer', args=(scouts, 'logs', jobs)) t.daemon = True