Revision: 5754 Author: nicdumz Date: 2008-07-24 18:06:40 +0000 (Thu, 24 Jul 2008)
Log Message: ----------- nah, the sleep(1) trick was not working, moving the cache deletions at the end of _flush
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2008-07-24 17:38:01 UTC (rev 5753) +++ trunk/pywikipedia/wikipedia.py 2008-07-24 18:06:40 UTC (rev 5754) @@ -6393,16 +6393,6 @@ when it has stopped doing so. After a bot has run stopme() it will not slow down other bots any more. """ - if config.use_diskcache: - for site in _sites.itervalues(): - if site._mediawiki_messages: - try: - while(_putthread.isAlive()): - time.sleep(1) - site._mediawiki_messages.delete() - except OSError: - # stopme has been called several times... - pass get_throttle.drop()
def _flush(): @@ -6440,6 +6430,13 @@ get_throttle.drop() except NameError: pass + if config.use_diskcache: + for site in _sites.itervalues(): + if site._mediawiki_messages: + try: + site._mediawiki_messages.delete() + except OSError: + pass
import atexit atexit.register(_flush)
pywikipedia-l@lists.wikimedia.org