ReviewBot: runner: reload checker and reset memoize session caches.

Otherwise, memoize(session=True) caches are kept until the process is
stopped which is obviously not how they were intended to be used. This
can cause incorrect behavior and continued memory growth.
This commit is contained in:
Jimmy Berry 2018-04-27 15:21:36 -05:00
parent f51dc98850
commit b20c01669e

View File

@ -30,6 +30,7 @@ from osclib.comments import CommentAPI
from osclib.conf import Config
from osclib.core import group_members
from osclib.memoize import memoize
from osclib.memoize import memoize_session_reset
from osclib.stagingapi import StagingAPI
import signal
import datetime
@ -719,7 +720,17 @@ class CommandLineInterface(cmdln.Cmdln):
else:
self.logger.info("sleeping %d minutes." % interval)
time.sleep(interval * 60)
# Reset all memoize session caches which are designed for single
# tool run and not extended usage.
memoize_session_reset()
# Reload checker to flush instance variables and thus any config
# or caches they may contain.
self.postoptparse()
continue
break
if __name__ == "__main__":