Skip to content

Commit

Permalink
cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
netort committed Jan 23, 2018
1 parent a93b4b1 commit 82b5ec5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions volta/listeners/uploader/uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ def run(self):
self._finished.set()

def __get_from_queue_prepare_and_send(self):
q_data = get_nowait_from_queue(self.uploader.inner_queue)
pending_batch = self.__prepare_batch_of_chunks(q_data)
pending_batch = self.__prepare_batch_of_chunks(
get_nowait_from_queue(self.uploader.inner_queue)
)
for type_ in self.uploader.data_types_to_tables:
if pending_batch[type_]:
prepared_body = "".join(key for key in pending_batch[type_])
Expand Down Expand Up @@ -164,10 +165,8 @@ def __prepare_batch_of_chunks(self, q_data):
logger.warning('Unknown data type for DataUplaoder, dropped: %s', exc_info=True)
return pending_data


def __send_chunk(self, url, data):
def __send_chunk(self, url, data, timeout=10):
""" TODO: add more stable and flexible retries """
timeout = 10
try:
r = requests.post(url, data=data, verify=False, timeout=timeout)
except requests.ConnectionError, requests.ConnectTimeout:
Expand Down

0 comments on commit 82b5ec5

Please sign in to comment.