Moved retry config to constants
This commit is contained in:
parent
0fa5bf54cd
commit
29180a1d2b
@ -312,6 +312,8 @@ CONF_SCHEMA = {
|
|||||||
'type': 'object',
|
'type': 'object',
|
||||||
'properties': {
|
'properties': {
|
||||||
'enabled': {'type': 'boolean'},
|
'enabled': {'type': 'boolean'},
|
||||||
|
'retries': {'type': 'integer', 'minimum': 0},
|
||||||
|
'retry_delay': {'type': 'number', 'minimum': 0},
|
||||||
'webhookbuy': {'type': 'object'},
|
'webhookbuy': {'type': 'object'},
|
||||||
'webhookbuycancel': {'type': 'object'},
|
'webhookbuycancel': {'type': 'object'},
|
||||||
'webhooksell': {'type': 'object'},
|
'webhooksell': {'type': 'object'},
|
||||||
|
@ -33,9 +33,6 @@ class Webhook(RPCHandler):
|
|||||||
self._retries = self._config['webhook'].get('retries', 0)
|
self._retries = self._config['webhook'].get('retries', 0)
|
||||||
self._retry_delay = self._config['webhook'].get('retry_delay', 0.1)
|
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']):
|
if not (self._format in ['form', 'json', 'raw']):
|
||||||
raise NotImplementedError('Unknown webhook format `{}`, possible values are '
|
raise NotImplementedError('Unknown webhook format `{}`, possible values are '
|
||||||
'`form` (default), `json`, and `raw`'.format(self._format))
|
'`form` (default), `json`, and `raw`'.format(self._format))
|
||||||
|
Loading…
Reference in New Issue
Block a user