Skip to content

Commit

Permalink
change downloadbars dupe to appendlog
Browse files Browse the repository at this point in the history
  • Loading branch information
datawhores committed Nov 27, 2023
1 parent 852459d commit e32f79e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ofscraper/prompts/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
19 changes: 13 additions & 6 deletions ofscraper/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand All @@ -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()
Expand All @@ -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()
Expand Down

0 comments on commit e32f79e

Please sign in to comment.