jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/608834 )
Change subject: Revert "[IMPR] Wait for _putthread is done in BaseBot.exit()" ......................................................................
Revert "[IMPR] Wait for _putthread is done in BaseBot.exit()"
This reverts commit 87cfda61cd98c9a0af73ed814a789e0dde266e8f.
Reason for revert: async put is blocked after this patch and no page is written to site. Queue increases up to ist limit and blocks after that.
Change-Id: I999f39da384ba754e045c60309d3737f0e7c3309 --- M pywikibot/bot.py 1 file changed, 7 insertions(+), 15 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py index c111c31..1dc7855 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -1289,36 +1289,28 @@ May be overridden by subclasses. """ self.teardown() - if hasattr(self, '_start_ts'): - read_delta = pywikibot.Timestamp.now() - self._start_ts - read_seconds = int(read_delta.total_seconds()) - - if pywikibot._putthread.is_alive(): - pywikibot._flush() - pywikibot.output('\n{} pages read' '\n{} pages written' '\n{} pages skipped' .format(self._treat_counter, self._save_counter, self._skip_counter)) - if hasattr(self, '_start_ts'): - write_delta = pywikibot.Timestamp.now() - self._start_ts - write_seconds = int(write_delta.total_seconds()) - if write_delta.days: + delta = (pywikibot.Timestamp.now() - self._start_ts) + seconds = int(delta.total_seconds()) + if delta.days: pywikibot.output( 'Execution time: {d.days} days, {d.seconds} seconds' - .format(d=write_delta)) + .format(d=delta)) else: pywikibot.output('Execution time: {} seconds' - .format(write_delta.seconds)) + .format(delta.seconds)) if self._treat_counter: pywikibot.output('Read operation time: {:.1f} seconds' - .format(read_seconds / self._treat_counter)) + .format(seconds / self._treat_counter)) if self._save_counter: pywikibot.output('Write operation time: {:.1f} seconds' - .format(write_seconds / self._save_counter)) + .format(seconds / self._save_counter))
# exc_info contains exception from self.run() while terminating exc_info = sys.exc_info()