(self, cache_type=None, cache_args={})
| 112 | |
| 113 | class CacheSet: |
| 114 | def __init__(self, cache_type=None, cache_args={}): |
| 115 | if cache_type == CacheType.NONE: |
| 116 | self.init_null_cache() |
| 117 | logging.info("Disabling intermediate node cache.") |
| 118 | elif cache_type == CacheType.RAM_PRESSURE: |
| 119 | cache_ram = cache_args.get("ram", 16.0) |
| 120 | self.init_ram_cache(cache_ram) |
| 121 | logging.info("Using RAM pressure cache.") |
| 122 | elif cache_type == CacheType.LRU: |
| 123 | cache_size = cache_args.get("lru", 0) |
| 124 | self.init_lru_cache(cache_size) |
| 125 | logging.info("Using LRU cache") |
| 126 | else: |
| 127 | self.init_classic_cache() |
| 128 | |
| 129 | self.all = [self.outputs, self.objects] |
| 130 | |
| 131 | # Performs like the old cache -- dump data ASAP |
| 132 | def init_classic_cache(self): |
nothing calls this directly
no test coverage detected