(func: Callable[..., T])
| 527 | """ |
| 528 | |
| 529 | def decorator(func: Callable[..., T]) -> Callable[..., T]: |
| 530 | # Create a single cache instance for this function |
| 531 | cache = CloudObjectCache( |
| 532 | max_size=max_size, |
| 533 | fetch_fn=func, |
| 534 | missing_expire_seconds=missing_expire_seconds, |
| 535 | exists_expire_seconds=exists_expire_seconds, |
| 536 | missing_object_value=missing_object_value, |
| 537 | ) |
| 538 | |
| 539 | async def wrapper(*args, **kwargs): |
| 540 | # Extract the key from either first positional arg or object_uri kwarg |
| 541 | key = args[0] if args else kwargs.get("object_uri") |
| 542 | return await cache.aget(key) |
| 543 | |
| 544 | return wrapper |
| 545 | |
| 546 | return decorator |
nothing calls this directly
no test coverage detected
searching dependent graphs…