@_enable_lock<EOL><INDENT>def start_regularly_cleanup(self, regularly_cleanup_interval=None, only_read=False):<DEDENT>
if not hasattr(self, '<STR_LIT>') or self.cleanup_supervisor is None:<EOL><INDENT>if regularly_cleanup_interval is None or not isinstance(regularly_cleanup_interval, int):<EOL><INDENT>regularly_cleanup_interval = self.regularly_cleanup_interval<EOL><DEDENT>cleanup_supervisor = CleanupSupervisorThread(cache=self, logger=self.logger,<EOL>interval=regularly_cleanup_interval)<EOL>cleanup_supervisor.start()<EOL>self.cleanup_supervisor = cleanup_supervisor<EOL>return True<EOL><DEDENT>else:<EOL><INDENT>self.logger.warning('<STR_LIT>' % self.cleanup_supervisor.name)<EOL>return False<EOL><DEDENT>
>>> cache = Cache(regularly_cleanup=False, log_level=logging.ERROR)
>>> cache.start_regularly_cleanup()
True
>>> cache.start_regularly_cleanup()
False