r86315 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86314‎ | r86315 | r86316 >
Date:16:01, 18 April 2011
Author:ariel
Status:deferred
Tags:
Comment:
error return after all commands have run, not after the first one (caused only one stub recombine to run)
Modified paths:
  • /branches/ariel/xmldumps-backup/worker.py (modified) (history)

Diff [purge]

Index: branches/ariel/xmldumps-backup/worker.py
@@ -1489,6 +1489,7 @@
14901490 return(XmlStub.listFiles(self, runner, unnumbered=True))
14911491
14921492 def run(self, runner):
 1493+ errorresult=0
14931494 if (self._chunks):
14941495 files = XmlStub.listFiles(self,runner)
14951496 outputFileList = self.listFiles(runner)
@@ -1510,7 +1511,9 @@
15111512 recombinePipeline = [ recombineCommand ]
15121513 series = [ recombinePipeline ]
15131514 result = runner.runCommand([ series ], callbackTimed=self.progressCallback, callbackTimedArg=runner, shell = True)
1514 - return result
 1515+ if result:
 1516+ errorresult = result
 1517+ return errorresult
15151518
15161519 class XmlLogging(Dump):
15171520 """ Create a logging dump of all page activity """
@@ -1871,6 +1874,7 @@
18721875 return(XmlDump.listFiles(self, runner, unnumbered=True))
18731876
18741877 def run(self, runner):
 1878+ errorresult=0
18751879 if (self._chunks):
18761880 files = XmlDump.listFiles(self,runner)
18771881 outputFileList = self.listFiles(runner)
@@ -1892,7 +1896,9 @@
18931897 recombinePipeline = [ recombineCommand ]
18941898 series = [ recombinePipeline ]
18951899 result = runner.runCommand([ series ], callbackTimed=self.progressCallback, callbackTimedArg=runner, shell = True)
1896 - return result
 1900+ if result:
 1901+ errorresult = result
 1902+ return errorresult
18971903
18981904 class BigXmlDump(XmlDump):
18991905 """XML page dump for something larger, where a 7-Zip compressed copy
@@ -2001,6 +2007,7 @@
20022008 return(XmlRecompressDump.listFiles(self, runner, unnumbered=True))
20032009
20042010 def run(self, runner):
 2011+ errorresult = 0
20052012 if (self._chunks):
20062013 files = XmlRecompressDump.listFiles(self,runner)
20072014 outputFileList = self.listFiles(runner)
@@ -2022,7 +2029,9 @@
20232030 recombinePipeline = [ recombineCommand ]
20242031 series = [ recombinePipeline ]
20252032 result = runner.runCommand([ series ], callbackTimed=self.progressCallback, callbackTimedArg=runner, shell = True)
2026 - return result
 2033+ if result:
 2034+ errorresult = result
 2035+ return errorresult
20272036
20282037 class AbstractDump(Dump):
20292038 """XML dump for Yahoo!'s Active Abstracts thingy"""
@@ -2117,6 +2126,7 @@
21182127 return(AbstractDump.listFiles(self,runner, unnumbered = True))
21192128
21202129 def run(self, runner):
 2130+ errorresult = 0
21212131 if (self._chunks):
21222132 files = AbstractDump.listFiles(self,runner)
21232133 outputFileList = self.listFiles(runner)
@@ -2137,7 +2147,9 @@
21382148 recombinePipeline = [ recombineCommand ]
21392149 series = [ recombinePipeline ]
21402150 result = runner.runCommand([ series ], callbackTimed=self.progressCallback, callbackTimedArg=runner, shell = True)
2141 - return result
 2151+ if result:
 2152+ errorresult = result
 2153+ return errorresult
21422154
21432155 class TitleDump(Dump):
21442156 """This is used by "wikiproxy", a program to add Wikipedia links to BBC news online"""
@@ -2146,11 +2158,11 @@
21472159 # try this initially and see how it goes
21482160 maxretries = 3
21492161 query="select page_title from page where page_namespace=0;"
2150 - error = runner.dbServerInfo.saveSql(query, runner.dumpDir.publicPath("all-titles-in-ns0.gz"))
 2162+ error = runner.saveSql(query, runner.dumpDir.publicPath("all-titles-in-ns0.gz"))
21512163 while (error and retries < maxretries):
21522164 retries = retries + 1
21532165 time.sleep(5)
2154 - error = runner.dbServerInfo.saveSql(query, runner.dumpDir.publicPath("all-titles-in-ns0.gz"))
 2166+ error = runner.saveSql(query, runner.dumpDir.publicPath("all-titles-in-ns0.gz"))
21552167 return error
21562168
21572169 def listFiles(self, runner):

Status & tagging log