(*args, **kwargs)
| 233 | |
| 234 | @functools.wraps(func) |
| 235 | def sync_wrapper(*args, **kwargs): |
| 236 | cache_key = _generate_cache_key(func, args, kwargs) |
| 237 | |
| 238 | if backend.has_key(cache_key): |
| 239 | logger.debug(f"Cache hit for {cache_key}") |
| 240 | return backend.get(cache_key) |
| 241 | |
| 242 | result = func(*args, **kwargs) |
| 243 | picklable_result = _make_pydantic_picklable(result) |
| 244 | backend.set(cache_key, picklable_result) |
| 245 | return result |
| 246 | |
| 247 | return async_wrapper if is_async else sync_wrapper |
| 248 |
nothing calls this directly
no test coverage detected
searching dependent graphs…