Moved retry config to constants

This commit is contained in:
Spat 2021-11-29 10:48:35 +11:00
parent 0fa5bf54cd
commit 29180a1d2b
2 changed files with 2 additions and 3 deletions

View File

@ -312,6 +312,8 @@ CONF_SCHEMA = {
'type': 'object',
'properties': {
'enabled': {'type': 'boolean'},
'retries': {'type': 'integer', 'minimum': 0},
'retry_delay': {'type': 'number', 'minimum': 0},
'webhookbuy': {'type': 'object'},
'webhookbuycancel': {'type': 'object'},
'webhooksell': {'type': 'object'},

View File

@ -33,9 +33,6 @@ class Webhook(RPCHandler):
self._retries = self._config['webhook'].get('retries', 0)
self._retry_delay = self._config['webhook'].get('retry_delay', 0.1)
if self._retries < 0: self._retries = 0
if self._retry_delay < 0: self._retry_delay = 0
if not (self._format in ['form', 'json', 'raw']):
raise NotImplementedError('Unknown webhook format `{}`, possible values are '
'`form` (default), `json`, and `raw`'.format(self._format))