Skip to content

Commit

Permalink
Retrievers parameters based on DEFAULT_RETRIEVERS_PARAMS
Browse files Browse the repository at this point in the history
  • Loading branch information
ktarasz authored Jan 14, 2019
1 parent 910d6c0 commit af847e7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions openprocurement_client/resources/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from openprocurement_client.clients import APIResourceClientSync
from openprocurement_client.utils import get_response

from copy import deepcopy

DEFAULT_RETRIEVERS_PARAMS = {
'down_requests_sleep': 5,
Expand All @@ -36,7 +36,7 @@ class ResourceFeeder(object):
def __init__(self, host=DEFAULT_API_HOST, version=DEFAULT_API_VERSION,
key=DEFAULT_API_KEY, resource='tenders',
extra_params=DEFAULT_API_EXTRA_PARAMS,
retrievers_params=DEFAULT_RETRIEVERS_PARAMS, adaptive=False,
retrievers_params={}, adaptive=False,
with_priority=False):
super(ResourceFeeder, self).__init__()
LOGGER.info('Init Resource Feeder...')
Expand All @@ -47,7 +47,8 @@ def __init__(self, host=DEFAULT_API_HOST, version=DEFAULT_API_VERSION,
self.adaptive = adaptive

self.extra_params = extra_params
self.retrievers_params = retrievers_params
self.retrievers_params = deepcopy(DEFAULT_RETRIEVERS_PARAMS)
self.retrievers_params.update(retrievers_params)
self.queue = PriorityQueue(maxsize=retrievers_params['queue_size'])

self.forward_priority = 1 if with_priority else 0
Expand Down

0 comments on commit af847e7

Please sign in to comment.