r109922 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109921‎ | r109922 | r109923 >
Date:11:17, 24 January 2012
Author:ariel
Status:deferred
Tags:
Comment:
don't send email on failure for runs of isolated jobs
Modified paths:
  • /branches/ariel/xmldumps-backup/worker.py (modified) (history)

Diff [purge]

Index: branches/ariel/xmldumps-backup/worker.py
@@ -1383,7 +1383,7 @@
13841384 # everything that has to do with reporting the status of a piece
13851385 # of a dump is collected here
13861386 class Status(object):
1387 - def __init__(self, wiki, dumpDir, items, checksums, enabled, noticeFile = None, errorCallback=None, verbose = False):
 1387+ def __init__(self, wiki, dumpDir, items, checksums, enabled, email = True, noticeFile = None, errorCallback=None, verbose = False):
13881388 self.wiki = wiki
13891389 self.dbName = wiki.dbName
13901390 self.dumpDir = dumpDir
@@ -1394,13 +1394,14 @@
13951395 self.failCount = 0
13961396 self.verbose = verbose
13971397 self._enabled = enabled
 1398+ self.email = email
13981399
13991400 def updateStatusFiles(self, done=False):
14001401 if self._enabled:
14011402 self._saveStatusSummaryAndDetail(done)
14021403
14031404 def reportFailure(self):
1404 - if self._enabled:
 1405+ if self._enabled and self.email:
14051406 if self.wiki.config.adminMail:
14061407 subject = "Dump failure for " + self.dbName
14071408 message = self.wiki.config.readTemplate("errormail.txt") % {
@@ -1698,7 +1699,12 @@
16991700
17001701 # some or all of these dumpItems will be marked to run
17011702 self.dumpItemList = DumpItemList(self.wiki, self.prefetch, self.spawn, self._chunkToDo, self.checkpointFile, self.jobRequested, self.chunkInfo, self.pageIDRange, self.runInfoFile, self.dumpDir)
1702 - self.status = Status(self.wiki, self.dumpDir, self.dumpItemList.dumpItems, self.checksums, self._statusEnabled, self.htmlNoticeFile, self.logAndPrint, self.verbose)
 1703+ # only send email failure notices for full runs
 1704+ if (self.jobRequested):
 1705+ email = False
 1706+ else:
 1707+ email = True
 1708+ self.status = Status(self.wiki, self.dumpDir, self.dumpItemList.dumpItems, self.checksums, self._statusEnabled, email, self.htmlNoticeFile, self.logAndPrint, self.verbose)
17031709
17041710 def logQueueReader(self,log):
17051711 if not log:

Status & tagging log