From: Graeme M. <ma...@us...> - 2005-01-26 16:06:22
|
Update of /cvsroot/mailmanager/mailmanager/migration In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5941/migration Modified Files: MailManager.py Log Message: * CHANGES.txt: - mention the attachment work. * migration/MailManager.py: - As a performance enhancement, don't iterate through all the accounts and tickets to migrate them unless we have to. * Makefile: - Tidy up a little more. Wouldn't want to go shipping core files, eh? Index: MailManager.py =================================================================== RCS file: /cvsroot/mailmanager/mailmanager/migration/MailManager.py,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- MailManager.py 16 Jan 2005 21:58:32 -0000 1.22 +++ MailManager.py 26 Jan 2005 16:06:13 -0000 1.23 @@ -29,15 +29,19 @@ """ from Products.MailManager import MailManager, MailCheckThread - # Migrate children. - if hasattr(self, 'accounts'): - for account in self.accounts.objectValues(): - account.migrate() - else: - for ticket in self.tickets.objectValues(): - ticket.migrate() - mversion = getattr(self, 'mversion', 0) + # An attempt at a performance boost for the poor folks with lots of + # tickets that don't need to be migrated. The mversion of the children + # of the MailManager instance haven't changed since 1.0rc2. + if mversion < 4: + # Migrate children. + if hasattr(self, 'accounts'): + for account in self.accounts.objectValues(): + account.migrate() + else: + for ticket in self.tickets.objectValues(): + ticket.migrate() + if mversion != MailManager.mversion: zLOG.LOG('MailManager:', 0, 'Updating MailManager: %s.' % self.absolute_url()) |