From e32f79e1026d2543bdc4130ec06e0b5b8511a93f Mon Sep 17 00:00:00 2001 From: datawhores Date: Sun, 26 Nov 2023 21:08:00 -0600 Subject: [PATCH] change downloadbars dupe to appendlog --- ofscraper/prompts/prompts.py | 2 +- ofscraper/start.py | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ofscraper/prompts/prompts.py b/ofscraper/prompts/prompts.py index 8e049d27d..1b22391b8 100644 --- a/ofscraper/prompts/prompts.py +++ b/ofscraper/prompts/prompts.py @@ -466,7 +466,7 @@ def config_prompt_advanced(config_) -> dict: }, { "type":"list", - "name":"downloadbars", + "name":"appendlog", "message":"append logs into daily log files", "default":config.get_appendlog(config_) , 'choices':[Choice(True,"Yes"),Choice(False,"No")] diff --git a/ofscraper/start.py b/ofscraper/start.py index 05a4847ad..64227f209 100644 --- a/ofscraper/start.py +++ b/ofscraper/start.py @@ -83,7 +83,10 @@ def main(): with exit.DelayedKeyboardInterrupt(): main_event.set() main_log_thread.join() - if other_log_process:other_log_process.join(timeout=1) + if other_log_process: + other_log_process.join(timeout=20) + if other_log_process.is_alive():other_log_process.terminate() + if other_log_thread:other_event.set();other_log_thread.join() logger.queue_.close() logger.queue_.cancel_join_thread() @@ -100,9 +103,9 @@ def main(): with exit.DelayedKeyboardInterrupt(): main_event.set() main_log_thread.join() - if other_log_process:other_log_process.join(timeout=1) - if other_log_thread:other_event.set();other_log_thread.join() - logger.queue_.close() + if other_log_process: + other_log_process.join(timeout=20) + if other_log_process.is_alive():other_log_process.terminate() logger.queue_.cancel_join_thread() manager.shutdown() raise E @@ -113,7 +116,9 @@ def main(): with exit.DelayedKeyboardInterrupt(): main_event.set() main_log_thread.join() - if other_log_process:other_log_process.join(timeout=1) + if other_log_process: + other_log_process.join(timeout=20) + if other_log_process.is_alive():other_log_process.terminate() if other_log_thread:other_event.set();other_log_thread.join() logger.queue_.close() logger.queue_.cancel_join_thread() @@ -132,7 +137,9 @@ def main(): with exit.DelayedKeyboardInterrupt(): main_event.set() main_log_thread.join() - if other_log_process:other_log_process.join() + if other_log_process: + other_log_process.join(timeout=20) + if other_log_process.is_alive():other_log_process.terminate() if other_log_thread:other_event.set();other_log_thread.join() logger.queue_.close() logger.queue_.cancel_join_thread()