Skip to content

Commit

Permalink
Merge pull request #3 from VolVoz/master
Browse files Browse the repository at this point in the history
adaptive delay
  • Loading branch information
vmaksymiv committed May 6, 2016
2 parents 1670e3a + 6e8a926 commit c3ac972
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion openprocurement/contracting/api/databridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ def get_tenders(self, client):
request_id = generate_req_id()
client.headers.update({'X-Client-Request-ID': request_id})
tenders_list = list(client.get_tenders())
delay = 101
if tenders_list:
delay = 15
logger.info("Client params: {}".format(client.params))
for tender in tenders_list:
if tender['status'] in ("active.qualification",
Expand All @@ -102,7 +104,7 @@ def get_tenders(self, client):
logger.debug('Skipping tender {} in status {}'.format(tender['id'], tender['status']))

logger.info('Sleep...')
time.sleep(15)
time.sleep(delay)

def get_tender_contracts(self):
while True:
Expand Down

0 comments on commit c3ac972

Please sign in to comment.