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:
parent
f51dc98850
commit
b20c01669e
11
ReviewBot.py
11
ReviewBot.py
@ -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__":
|
||||
|
Loading…
x
Reference in New Issue
Block a user