Fix non-terminating bot
This commit is contained in:
parent
1d18e0a11a
commit
edc0d7f2c7
@ -27,7 +27,6 @@ def main(sysargv: List[str] = None) -> None:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
return_code: Any = 1
|
return_code: Any = 1
|
||||||
worker = None
|
|
||||||
try:
|
try:
|
||||||
arguments = Arguments(sysargv)
|
arguments = Arguments(sysargv)
|
||||||
args = arguments.get_parsed_arg()
|
args = arguments.get_parsed_arg()
|
||||||
@ -57,8 +56,6 @@ def main(sysargv: List[str] = None) -> None:
|
|||||||
except Exception:
|
except Exception:
|
||||||
logger.exception('Fatal exception!')
|
logger.exception('Fatal exception!')
|
||||||
finally:
|
finally:
|
||||||
if worker:
|
|
||||||
worker.exit()
|
|
||||||
sys.exit(return_code)
|
sys.exit(return_code)
|
||||||
|
|
||||||
|
|
||||||
|
@ -45,8 +45,15 @@ def start_trading(args: Dict[str, Any]) -> int:
|
|||||||
"""
|
"""
|
||||||
from freqtrade.worker import Worker
|
from freqtrade.worker import Worker
|
||||||
# Load and run worker
|
# Load and run worker
|
||||||
|
try:
|
||||||
worker = Worker(args)
|
worker = Worker(args)
|
||||||
worker.run()
|
worker.run()
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
logger.info('SIGINT received, aborting ...')
|
||||||
|
finally:
|
||||||
|
if worker:
|
||||||
|
logger.info("worker found ... calling exit")
|
||||||
|
worker.exit()
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user