Fix if queue tag default does not exist and --queue not specified, try queue name "default"

This commit is contained in:
allegroai 2021-10-16 23:21:45 +03:00
parent 2a941e3abf
commit 175e99b12b

View File

@ -3519,8 +3519,13 @@ class Worker(ServiceCommandSection):
def _resolve_queue_names(self, queues, create_if_missing=False):
if not queues:
default_queue = self._session.send_api(queues_api.GetDefaultRequest())
return [default_queue.id]
# try to look for queues with "default" tag
try:
default_queue = self._session.send_api(queues_api.GetDefaultRequest())
return [default_queue.id]
except APIError:
# if we cannot find one with "default" tag, look for a queue named "default"
queues = ["default"]
queues = return_list(queues)
if not create_if_missing: