Changeset 28
- Timestamp:
- 10/16/07 03:26:29 (1 year ago)
- Location:
- branches/2.0.5
- Files:
-
- 1 added
- 1 modified
-
tests/test_errorhandling.py (added)
-
turbomail/pool.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0.5/turbomail/pool.py
r26 r28 4 4 5 5 import logging 6 import smtplib 7 import socket 8 import time 6 9 log = logging.getLogger("turbomail.pool") 7 10 … … 203 206 break 204 207 208 unit = None 205 209 try: 206 210 unit = self._queue.get(True, self._timeout) … … 210 214 log.debug("Worker death from starvation.") 211 215 break 216 except (socket.error, smtplib.SMTPException), exception: 217 log.exception(exception) 218 log.error("Exception occured when sending mail. Retrying...") 219 time.sleep(1) 220 self._queue.put(unit, block=False) 221 log.debug("Worker death by exception.") 222 break 212 223 213 224 count += 1
