| 158 | |
| 159 | |
| 160 | class CacheHook: |
| 161 | def __init__(self, cachinglm) -> None: |
| 162 | if cachinglm is None: |
| 163 | self.dbdict = None |
| 164 | return |
| 165 | |
| 166 | self.dbdict = cachinglm.dbdict |
| 167 | |
| 168 | def add_partial(self, attr, req, res) -> None: |
| 169 | if self.dbdict is None: |
| 170 | return |
| 171 | hsh = hash_args(attr, req) |
| 172 | self.dbdict[hsh] = res |
| 173 | |
| 174 | |
| 175 | class CachingLM: |
no outgoing calls
no test coverage detected