r104144 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104143‎ | r104144 | r104145 >
Date:09:29, 24 November 2011
Author:ariel
Status:deferred
Tags:
Comment:
get latest incr date now has optional check for successful run
Modified paths:
  • /branches/ariel/xmldumps-backup/incrementals/IncrDumpLib.py (modified) (history)
  • /branches/ariel/xmldumps-backup/incrementals/incrmonitor.py (modified) (history)

Diff [purge]

Index: branches/ariel/xmldumps-backup/incrementals/IncrDumpLib.py
@@ -385,10 +385,16 @@
386386 previous = dump
387387 return previous
388388
389 - def getLatestIncrDate(self):
 389+ def getLatestIncrDate(self, ok = False):
390390 # find the most recent incr dump
391391 dirs = self.getIncDumpDirs()
392392 if dirs:
393 - return(dirs[-1])
 393+ if ok:
 394+ for dump in dirs:
 395+ statusInfo = StatusInfo(self._config, dump, self.wikiName)
 396+ if statusInfo.getStatus(dump) == "done":
 397+ return dump
 398+ else:
 399+ return(dirs[-1])
394400 else:
395401 return(None)
Index: branches/ariel/xmldumps-backup/incrementals/incrmonitor.py
@@ -54,7 +54,7 @@
5555 if date:
5656 incrDate = date
5757 else:
58 - incrDate = self.incrDumpsDirs.getLatestIncrDate()
 58+ incrDate = self.incrDumpsDirs.getLatestIncrDate(True)
5959 if not incrDate:
6060 if (self.verbose):
6161 print "No dump for wiki ", w

Status & tagging log