Fix some formatting errors, add test for strategy version
This commit is contained in:
@@ -1305,10 +1305,11 @@ class Telegram(RPCHandler):
|
||||
:return: None
|
||||
"""
|
||||
strategy_version = self._rpc._freqtrade.strategy.version()
|
||||
if strategy_version is None:
|
||||
self._send_msg('*Version:* `{}`'.format(__version__))
|
||||
else:
|
||||
self._send_msg('*Freqtrade version:* `{}`, *Strategy version:* `{}`'.format(__version__, strategy_version))
|
||||
version_string = f'*Version:* `{__version__}`'
|
||||
if strategy_version is not None:
|
||||
version_string += f', *Strategy version: * `{strategy_version}`'
|
||||
|
||||
self._send_msg(version_string)
|
||||
|
||||
@authorized_only
|
||||
def _show_config(self, update: Update, context: CallbackContext) -> None:
|
||||
|
@@ -393,7 +393,7 @@ class IStrategy(ABC, HyperStrategyMixin):
|
||||
]
|
||||
"""
|
||||
return []
|
||||
|
||||
|
||||
def version(self) -> str:
|
||||
"""
|
||||
Returns version of the strategy.
|
||||
|
@@ -115,14 +115,14 @@ class Worker:
|
||||
if (now - self._heartbeat_msg) > self._heartbeat_interval:
|
||||
version = __version__
|
||||
strategy_version = self.freqtrade.strategy.version()
|
||||
if (strategy_version != None):
|
||||
version += ', strategy_version: ' + strategy_version
|
||||
if (strategy_version is not None):
|
||||
version += ', strategy_version: ' + strategy_version
|
||||
logger.info(f"Bot heartbeat. PID={getpid()}, "
|
||||
f"version='{version}', state='{state.name}'")
|
||||
self._heartbeat_msg = now
|
||||
|
||||
return state
|
||||
|
||||
|
||||
def _throttle(self, func: Callable[..., Any], throttle_secs: float, *args, **kwargs) -> Any:
|
||||
"""
|
||||
Throttles the given callable that it
|
||||
|
Reference in New Issue
Block a user