constrain port in config, catch value error
This commit is contained in:
parent
b0b575ead9
commit
4422ac7f45
@ -497,7 +497,12 @@ CONF_SCHEMA = {
|
|||||||
'properties': {
|
'properties': {
|
||||||
'name': {'type': 'string'},
|
'name': {'type': 'string'},
|
||||||
'host': {'type': 'string'},
|
'host': {'type': 'string'},
|
||||||
'port': {'type': 'integer', 'default': 8080},
|
'port': {
|
||||||
|
'type': 'integer',
|
||||||
|
'default': 8080,
|
||||||
|
'minimum': 0,
|
||||||
|
'maximum': 65535
|
||||||
|
},
|
||||||
'ws_token': {'type': 'string'},
|
'ws_token': {'type': 'string'},
|
||||||
},
|
},
|
||||||
'required': ['name', 'host', 'ws_token']
|
'required': ['name', 'host', 'ws_token']
|
||||||
|
@ -205,6 +205,10 @@ class ExternalMessageConsumer:
|
|||||||
# Now receive data, if none is within the time limit, ping
|
# Now receive data, if none is within the time limit, ping
|
||||||
await self._receive_messages(channel, producer, lock)
|
await self._receive_messages(channel, producer, lock)
|
||||||
|
|
||||||
|
except (websockets.exceptions.InvalidURI, ValueError) as e:
|
||||||
|
logger.error(f"{ws_url} is an invalid WebSocket URL - {e}")
|
||||||
|
break
|
||||||
|
|
||||||
except (
|
except (
|
||||||
socket.gaierror,
|
socket.gaierror,
|
||||||
ConnectionRefusedError,
|
ConnectionRefusedError,
|
||||||
|
Loading…
Reference in New Issue
Block a user