add init flag to server and fix SHOW_PROGRESS config being ignored

This commit is contained in:
Nick Sweeting
2020-07-28 05:57:34 -04:00
parent 55a237a435
commit 9e7330cc14
3 changed files with 37 additions and 13 deletions

View File

@@ -84,7 +84,9 @@ class TimedProgress:
"""Show a progress bar and measure elapsed time until .end() is called"""
def __init__(self, seconds, prefix=''):
if SHOW_PROGRESS:
from .config import SHOW_PROGRESS
self.SHOW_PROGRESS = SHOW_PROGRESS
if self.SHOW_PROGRESS:
self.p = Process(target=progress_bar, args=(seconds, prefix))
self.p.start()
@@ -96,7 +98,7 @@ class TimedProgress:
end_ts = datetime.now()
self.stats['end_ts'] = end_ts
if SHOW_PROGRESS:
if self.SHOW_PROGRESS:
# terminate if we havent already terminated
self.p.terminate()
self.p.join()