Revision: 5251 Author: btongminh Date: 2008-04-22 11:46:44 +0000 (Tue, 22 Apr 2008)
Log Message: ----------- Increase starvation time. Update image replacer to work with the new threadpool interface.
Modified Paths: -------------- trunk/pywikipedia/commonsdelinker/delinker.py trunk/pywikipedia/commonsdelinker/image_replacer.py
Modified: trunk/pywikipedia/commonsdelinker/delinker.py =================================================================== --- trunk/pywikipedia/commonsdelinker/delinker.py 2008-04-22 08:13:56 UTC (rev 5250) +++ trunk/pywikipedia/commonsdelinker/delinker.py 2008-04-22 11:46:44 UTC (rev 5251) @@ -434,7 +434,7 @@ pass class CheckUsage(threadpool.Thread): - timeout = 30 + timeout = 120 def __init__(self, pool, CommonsDelinker): threadpool.Thread.__init__(self, pool) self.CommonsDelinker = CommonsDelinker
Modified: trunk/pywikipedia/commonsdelinker/image_replacer.py =================================================================== --- trunk/pywikipedia/commonsdelinker/image_replacer.py 2008-04-22 08:13:56 UTC (rev 5250) +++ trunk/pywikipedia/commonsdelinker/image_replacer.py 2008-04-22 11:46:44 UTC (rev 5251) @@ -54,8 +54,7 @@ self.first_revision = 0 if self.config.get('replacer_report_replacements', False): - self.reporters = threadpool.ThreadPool(Reporter) - self.reporters.add_thread(self.site, self.config) + self.reporters = threadpool.ThreadPool(Reporter, 1, self.site, self.config) self.reporters.start() @@ -287,7 +286,10 @@ output('A critical error has occured! Aborting!') traceback.print_exc(file = sys.stderr) finally: - R.reporters.exit() + try: + R.reporters.exit() + except: + pass wikipedia.stopme() if __name__ == '__main__': main()