[Checkins] SVN: zope.sendmail/trunk/src/zope/sendmail/delivery.py if the QueueProcessorThread is asked to stop while sending messages, do so

Benji York benji at zope.com
Tue Oct 23 14:14:23 EDT 2007


Log message for revision 80969:
  if the QueueProcessorThread is asked to stop while sending messages, do so
  after sending the current message; previously if there were many, many
  messages to send, the thread could stick around for quite a while
  

Changed:
  U   zope.sendmail/trunk/src/zope/sendmail/delivery.py

-=-
Modified: zope.sendmail/trunk/src/zope/sendmail/delivery.py
===================================================================
--- zope.sendmail/trunk/src/zope/sendmail/delivery.py	2007-10-23 17:54:20 UTC (rev 80968)
+++ zope.sendmail/trunk/src/zope/sendmail/delivery.py	2007-10-23 18:14:23 UTC (rev 80969)
@@ -255,6 +255,10 @@
         atexit.register(self.stop)
         while not self.__stopped:
             for filename in self.maildir:
+                # if we are asked to stop while sending messages, do so
+                if self.__stopped:
+                    break
+
                 fromaddr = ''
                 toaddrs = ()
                 head, tail = os.path.split(filename)



More information about the Checkins mailing list