From d6597636722cf4f51eb6a5d380fbd3e6e0354366 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Fri, 4 Sep 2020 15:01:58 +0200 Subject: [PATCH] move blocking_file_io into Options --- respodns/dns.py | 4 +--- respodns/structs.py | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/respodns/dns.py b/respodns/dns.py index bb0ace6..cf78378 100644 --- a/respodns/dns.py +++ b/respodns/dns.py @@ -215,9 +215,7 @@ async def main(db, filepaths, checks, opts: Options): pooler = make_pooler(opts.ip_simul, finisher) - blocking_file_io = False # TODO: put in Options. - - if blocking_file_io: + if opts.blocking_file_io: from .ip_util import read_ips seen = 0 diff --git a/respodns/structs.py b/respodns/structs.py index f8d3691..c6d875f 100644 --- a/respodns/structs.py +++ b/respodns/structs.py @@ -16,7 +16,8 @@ class Options: impatient: bool = False # reduce retries and times for timeouts early_stopping: bool = True # stop at the first invalid domain dry: bool = True # don't write anything to database - progress: bool = False + progress: bool = False # periodically print progress to stderr + blocking_file_io: bool = False # halt execution until inputs arrive @dataclass