Skip to content

Commit

Permalink
Merge pull request #463 from tutorcruncher/catch-correct-timeout-errors
Browse files Browse the repository at this point in the history
I think this should catch correct errors now
  • Loading branch information
HenryTraill committed Oct 26, 2023
2 parents 3464d06 + 1406a0c commit 3dc914e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = '1.0.28'
VERSION = '1.0.29'
8 changes: 5 additions & 3 deletions src/worker/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
import logging
import re
from arq import Retry
from asyncio import CancelledError
from buildpg import MultipleValues, Values
from chevron import ChevronError
from concurrent.futures import TimeoutError
from datetime import datetime, timezone
from foxglove import glove
from httpx import ConnectError
from httpcore import ReadTimeout as HttpReadTimeout
from httpx import ConnectError, ReadTimeout
from itertools import chain
from pathlib import Path
from pydf import generate_pdf
Expand Down Expand Up @@ -122,11 +124,11 @@ async def _send_mandrill(self, email_info: EmailInfo, attachments: List[dict]):
defer = email_retrying[job_try - 1]
try:
if job_try >= 2:
main_logger.info('%s: sending data to mandrill', self.group_id)
main_logger.info('%s: ', self.group_id)
r = await self.ctx['mandrill'].post('messages/send.json', **data)
if job_try >= 2:
main_logger.info('%s: finished sending data to mandrill', self.group_id)
except (ConnectError, TimeoutError) as e:
except (ConnectError, TimeoutError, ReadTimeout, HttpReadTimeout, CancelledError) as e:
main_logger.info('client connection error group_id=%s job_try=%s defer=%ss', self.group_id, job_try, defer)
raise Retry(defer=defer) from e
except ApiError as e:
Expand Down

0 comments on commit 3dc914e

Please sign in to comment.