Skip to content

Commit

Permalink
missing extras
Browse files Browse the repository at this point in the history
  • Loading branch information
vmaksymiv committed Jun 3, 2016
1 parent 9e8bb1e commit 6a6b90c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions openprocurement/contracting/api/databridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,16 @@ def get_tenders(self, params={}, direction=""):
"active.awarded", "complete"):
if hasattr(tender, "lots"):
if any([1 for lot in tender['lots'] if lot['status'] == "complete"]):
logger.info('{} sync: Found multilot tender {} in status {}'.format(direction.capitalize(), tender['id'], tender['status']))
logger.info('{} sync: Found multilot tender {} in status {}'.format(direction.capitalize(), tender['id'], tender['status']),
extra={"TENDER_ID": tender['id']})
yield tender
elif tender['status'] == "complete":
logger.info('{} sync: Found tender in complete status {}'.format(direction.capitalize(), tender['id']))
logger.info('{} sync: Found tender in complete status {}'.format(direction.capitalize(), tender['id']),
extra={"TENDER_ID": tender['id']})
yield tender
else:
logger.debug('{} sync: Skipping tender {} in status {}'.format(direction.capitalize(), tender['id'], tender['status']))
logger.debug('{} sync: Skipping tender {} in status {}'.format(direction.capitalize(), tender['id'], tender['status']),
extra={"TENDER_ID": tender['id']})

logger.info('Sleep {} sync...'.format(direction))
time.sleep(delay)
Expand Down

0 comments on commit 6a6b90c

Please sign in to comment.