Skip to content

Commit

Permalink
Merge pull request #97 from ITVaan/412_in_check_api
Browse files Browse the repository at this point in the history
Added another error catching
  • Loading branch information
kroman0 authored Aug 10, 2017
2 parents b560cbe + 3826532 commit 8a4fb1a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions openprocurement/bot/identification/databridge/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from functools import partial
from yaml import load
from gevent.queue import Queue
from restkit import request, RequestError
from restkit import request, RequestError, ResourceError
from requests import RequestException
from constants import retry_mult
from openprocurement_client.client import TendersClientSync as BaseTendersClientSync, TendersClient as BaseTendersClient
Expand Down Expand Up @@ -160,7 +160,7 @@ def check_openprocurement_api(self):
"""Makes request to the TendersClient, returns True if it's up, raises RequestError otherwise"""
try:
self.client.head('/api/{}/spore'.format(self.api_version))
except RequestError as e:
except (RequestError, ResourceError) as e:
logger.info('TendersServer connection error, message {}'.format(e),
extra=journal_context({"MESSAGE_ID": DATABRIDGE_DOC_SERVICE_CONN_ERROR}, {}))
raise e
Expand All @@ -187,6 +187,7 @@ def check_services(self):
logger.info("All services are available")
self.set_wake_up()
else:
logger.info("Pausing bot")
self.set_sleep()

def _start_jobs(self):
Expand Down

0 comments on commit 8a4fb1a

Please sign in to comment.