Skip to content
This repository has been archived by the owner on Sep 12, 2022. It is now read-only.

Commit

Permalink
Updated Traptor with try catch for ChunkedEncodingError
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem Klintsevich authored and Artem Klintsevich committed Jun 9, 2017
1 parent ac49e19 commit a0368a5
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions traptor/traptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
from tenacity import retry, wait_exponential, stop_after_attempt, retry_if_exception_type, wait_chain, wait_fixed

from dog_whistle import dw_config, dw_callback
from requests.exceptions import ChunkedEncodingError

from scutils.log_factory import LogFactory
from scutils.stats_collector import StatsCollector
from traptor_limit_counter import TraptorLimitCounter
Expand Down Expand Up @@ -1101,8 +1103,17 @@ def run(self):

self.restart_flag = False

# Start collecting data
self._main_loop()
try:
# Start collecting data
self._main_loop()
except ChunkedEncodingError as e:
self.logger.error("Ran into a ChunkedEncodingError while processing "
"tweets. Restarting Traptor from top of main process "
"loop", {
'ex' : traceback.format_exc()
})




def main():
Expand Down

0 comments on commit a0368a5

Please sign in to comment.