Skip to content

Commit

Permalink
A default max_workers value for ThreadPoolExecutor doesn't exist unti…
Browse files Browse the repository at this point in the history
…l Python 3.5
  • Loading branch information
mschwager committed Feb 13, 2018
1 parent ce1de96 commit 6d2343f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fierce/fierce.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import http.client
import ipaddress
import itertools
import multiprocessing
import os
import pprint
import random
Expand Down Expand Up @@ -156,7 +157,10 @@ def search_filter(domains, address):
def find_nearby(resolver, ips, filter_func=None):
str_ips = [str(ip) for ip in ips]

with concurrent.futures.ThreadPoolExecutor() as executor:
# https://docs.python.org/3.5/library/concurrent.futures.html#concurrent.futures.ThreadPoolExecutor
max_workers = multiprocessing.cpu_count() * 5

with concurrent.futures.ThreadPoolExecutor(max_workers=max_workers) as executor:
reversed_ips = {
ip: query_result
for ip, query_result in zip(
Expand Down

0 comments on commit 6d2343f

Please sign in to comment.