INNER CODE UNIT · Python

_background_recalc_async

python-cachier/cachier · src/cachier/core.py:77

async def _background_recalc_async(
    core: _BaseCore,
    key: Any,
    func: Callable[..., Any],
    args: Any,
    kwds: Any,
) -> None:
    """Run async recomputation in background and clear processing flag.

    This helper ensures that the cache entry's "being calculated" state is cleared only after the background
    recomputation and cache update (performed by ``_function_thread_async``) have completed.

    """
    try:
        await _function_thread_async(core, key, func, args, kwds)
    finally:
        await core.amark_entry_not_calculated(key)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…