Index: branches/ariel/xmldumps-backup/worker.py |
— | — | @@ -1383,7 +1383,7 @@ |
1384 | 1384 | # everything that has to do with reporting the status of a piece |
1385 | 1385 | # of a dump is collected here |
1386 | 1386 | 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): |
1388 | 1388 | self.wiki = wiki |
1389 | 1389 | self.dbName = wiki.dbName |
1390 | 1390 | self.dumpDir = dumpDir |
— | — | @@ -1394,13 +1394,14 @@ |
1395 | 1395 | self.failCount = 0 |
1396 | 1396 | self.verbose = verbose |
1397 | 1397 | self._enabled = enabled |
| 1398 | + self.email = email |
1398 | 1399 | |
1399 | 1400 | def updateStatusFiles(self, done=False): |
1400 | 1401 | if self._enabled: |
1401 | 1402 | self._saveStatusSummaryAndDetail(done) |
1402 | 1403 | |
1403 | 1404 | def reportFailure(self): |
1404 | | - if self._enabled: |
| 1405 | + if self._enabled and self.email: |
1405 | 1406 | if self.wiki.config.adminMail: |
1406 | 1407 | subject = "Dump failure for " + self.dbName |
1407 | 1408 | message = self.wiki.config.readTemplate("errormail.txt") % { |
— | — | @@ -1698,7 +1699,12 @@ |
1699 | 1700 | |
1700 | 1701 | # some or all of these dumpItems will be marked to run |
1701 | 1702 | 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) |
1703 | 1709 | |
1704 | 1710 | def logQueueReader(self,log): |
1705 | 1711 | if not log: |