Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/a289093187735897_set_cookie_on_r…
Browse files Browse the repository at this point in the history
…einit'
  • Loading branch information
vmaksymiv committed Mar 9, 2017
2 parents 0a0fd65 + 03df174 commit 51bcde1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions openprocurement/tender/competitivedialogue/databridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,9 @@ def get_competitive_dialogue_forward(self):
{"TENDER_ID": tender_data['id']}))
self.competitive_dialogues_queue.put(tender_data)
except ResourceError as re:
if re.status_int == 412:
self.tenders_sync_client.headers['Cookie'] = re.response.headers['Set-Cookie']
logger.warn('Forward catch 412, update coockie and restart worker',extra=journal_context({"MESSAGE_ID": DATABRIDGE_WORKER_DIED}, {}))
logger.warn('Forward worker died!', extra=journal_context({"MESSAGE_ID": DATABRIDGE_WORKER_DIED}, {}))
logger.error("Error response {}".format(re.message))
raise re
Expand All @@ -655,6 +658,13 @@ def get_competitive_dialogue_backward(self):
extra=journal_context({"MESSAGE_ID": DATABRIDGE_TENDER_PROCESS},
{"TENDER_ID": tender_data['id']}))
self.competitive_dialogues_queue.put(tender_data)
except ResourceError as re:
if re.status_int == 412:
self.tenders_sync_client.headers['Cookie'] = re.response.headers['Set-Cookie']
logger.warn('Backward catch 412, update coockie and restart worker', extra=journal_context({"MESSAGE_ID": DATABRIDGE_WORKER_DIED}, {}))
logger.warn('Backward worker died!', extra=journal_context({"MESSAGE_ID": DATABRIDGE_WORKER_DIED}, {}))
logger.error("Error response {}".format(re.message))
raise re
except Exception, e:
# TODO reset queues and restart sync
logger.warn('Backward worker died!', extra=journal_context({"MESSAGE_ID": DATABRIDGE_WORKER_DIED}, {}))
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
import os

version = '1.0.12'
version = '1.0.13'

requires = [
'setuptools'
Expand Down

0 comments on commit 51bcde1

Please sign in to comment.