r20743 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r20742‎ | r20743 | r20744 >
Date:18:05, 27 March 2007
Author:brion
Status:old
Tags:
Comment:
go by age of the status.html file instead of age of the directory; should track running updates and cancellations better
Modified paths:
  • /trunk/backup/WikiDump.py (modified) (history)

Diff [purge]

Index: trunk/backup/WikiDump.py
@@ -139,19 +139,15 @@
140140 available = []
141141 for db in self.dbList:
142142 wiki = Wiki(self, db)
 143+ age = sys.maxint
143144 last = wiki.latestDump()
144145 if last:
145 - dumpDir = os.path.join(wiki.publicDir(), last)
 146+ dumpStatus = os.path.join(wiki.publicDir(), last, "status.html")
146147 try:
147 - age = fileAge(dumpDir)
 148+ age = fileAge(dumpStatus)
148149 except:
149 - print "dump dir %s vanished while looking at it!" % dumpDir
150 - available.append((sys.maxint, db))
151 - else:
152 - position = -1
153 - available.append((age, db))
154 - else:
155 - available.append((sys.maxint, db))
 150+ print "dump dir %s corrupt?" % dumpDir
 151+ available.append((age, db))
156152 available.sort()
157153 return [db for (age, db) in available]
158154