Unify main:
- same multiprocessing start method for start.sh and setuptools entry point, - make it possible to run outside of the main thread.
This commit is contained in:
parent
1368f4c85c
commit
83ddc63418
|
@ -263,9 +263,7 @@ def start_i2p_listener():
|
|||
|
||||
|
||||
def main():
|
||||
signal.signal(signal.SIGINT, handler)
|
||||
signal.signal(signal.SIGTERM, handler)
|
||||
|
||||
multiprocessing.set_start_method('spawn')
|
||||
parse_arguments()
|
||||
|
||||
logging.basicConfig(
|
||||
|
@ -273,6 +271,12 @@ def main():
|
|||
format='[%(asctime)s] [%(levelname)s] %(message)s')
|
||||
logging.info('Starting MiNode')
|
||||
|
||||
try:
|
||||
signal.signal(signal.SIGINT, handler)
|
||||
signal.signal(signal.SIGTERM, handler)
|
||||
except ValueError:
|
||||
logging.warning('Working outside of the main thread!')
|
||||
|
||||
logging.info('Data directory: %s', shared.data_directory)
|
||||
if not os.path.exists(shared.data_directory):
|
||||
try:
|
||||
|
@ -315,5 +319,4 @@ def main():
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
multiprocessing.set_start_method('spawn')
|
||||
main()
|
||||
|
|
Loading…
Reference in New Issue
Block a user