revert worker() changes

This commit is contained in:
gcarq 2018-03-21 19:27:30 +01:00
parent 9df5e09a82
commit b8f322d8f6

View File

@ -94,13 +94,14 @@ class FreqtradeBot(object):
:return: current service state :return: current service state
""" """
# Log state transition # Log state transition
if self.state != old_state: state = self.state
self.rpc.send_msg('*Status:* `{}`'.format(self.state.name.lower())) if state != old_state:
self.logger.info('Changing state to: %s', self.state.name) self.rpc.send_msg('*Status:* `{}`'.format(state.name.lower()))
self.logger.info('Changing state to: %s', state.name)
if self.state == State.STOPPED: if state == State.STOPPED:
time.sleep(1) time.sleep(1)
elif self.state == State.RUNNING: elif state == State.RUNNING:
min_secs = self.config.get('internals', {}).get( min_secs = self.config.get('internals', {}).get(
'process_throttle_secs', 'process_throttle_secs',
Constants.PROCESS_THROTTLE_SECS Constants.PROCESS_THROTTLE_SECS
@ -114,7 +115,7 @@ class FreqtradeBot(object):
self._throttle(func=self._process, self._throttle(func=self._process,
min_secs=min_secs, min_secs=min_secs,
nb_assets=nb_assets) nb_assets=nb_assets)
return self.state return state
def _throttle(self, func: Callable[..., Any], min_secs: float, *args, **kwargs) -> Any: def _throttle(self, func: Callable[..., Any], min_secs: float, *args, **kwargs) -> Any:
""" """