Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 43 for cache (0.35 sec)

  1. tests/test_dependency_cache.py

    ):
        return {"counter": count, "subcounter": subcount}
    
    
    @app.get("/sub-counter-no-cache/")
    async def get_sub_counter_no_cache(
        subcount: int = Depends(super_dep),
        count: int = Depends(dep_counter, use_cache=False),
    ):
        return {"counter": count, "subcounter": subcount}
    
    
    @app.get("/scope-counter")
    async def get_scope_counter(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Aug 23 13:30:24 GMT 2022
    - 2.7K bytes
    - Viewed (0)
  2. fastapi/dependencies/models.py

            self.name = name
            self.call = call
            self.use_cache = use_cache
            # Store the path to be able to re-generate a dependable from it in overrides
            self.path = path
            # Save the cache key at creation to optimize performance
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 2.4K bytes
    - Viewed (0)
  3. tests/test_params_repr.py

        assert repr(Depends()) == "Depends(NoneType)"
        assert repr(Depends(get_user)) == "Depends(get_user)"
        assert repr(Depends(use_cache=False)) == "Depends(NoneType, use_cache=False)"
        assert (
            repr(Depends(get_user, use_cache=False)) == "Depends(get_user, use_cache=False)"
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 3.3K bytes
    - Viewed (0)
  4. docs_src/settings/app02_an_py39/main.py

    from functools import lru_cache
    from typing import Annotated
    
    from fastapi import Depends, FastAPI
    
    from .config import Settings
    
    app = FastAPI()
    
    
    @lru_cache
    def get_settings():
        return Settings()
    
    
    @app.get("/info")
    async def info(settings: Annotated[Settings, Depends(get_settings)]):
        return {
            "app_name": settings.app_name,
            "admin_email": settings.admin_email,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 445 bytes
    - Viewed (0)
  5. .github/workflows/test-redistribute.yml

          - name: Set up Python
            uses: actions/setup-python@v5
            with:
              python-version: "3.10"
              # Issue ref: https://github.com/actions/setup-python/issues/436
              # cache: "pip"
              # cache-dependency-path: pyproject.toml
          - name: Install build dependencies
            run: pip install build
          - name: Build source distribution
            run: python -m build --sdist
    Others
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 28 23:28:07 GMT 2024
    - 1.4K bytes
    - Viewed (0)
  6. docs/em/docs/advanced/settings.md

    `@lru_cache` 🍕 `functools` ❔ 🍕 🐍 🐩 🗃, 👆 💪 ✍ 🌅 🔃 ⚫️ <a href="https://docs.python.org/3/library/functools.html#functools.lru_cache" class="external-link" target="_blank">🐍 🩺 `@lru_cache`</a>.
    
    ## 🌃
    
    👆 💪 ⚙️ Pydantic ⚒ 🍵 ⚒ ⚖️ 📳 👆 🈸, ⏮️ 🌐 🏋️ Pydantic 🏷.
    
    * ⚙️ 🔗 👆 💪 📉 🔬.
    * 👆 💪 ⚙️ `.env` 📁 ⏮️ ⚫️.
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 11.4K bytes
    - Viewed (0)
  7. fastapi/dependencies/utils.py

                continue
            if sub_dependant.use_cache and sub_dependant.cache_key in dependency_cache:
                solved = dependency_cache[sub_dependant.cache_key]
            elif is_gen_callable(call) or is_async_gen_callable(call):
                solved = await solve_generator(
                    call=call, stack=async_exit_stack, sub_values=sub_values
                )
            elif is_coroutine_callable(call):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:52:56 GMT 2024
    - 29.5K bytes
    - Viewed (0)
  8. .github/workflows/test.yml

            uses: actions/setup-python@v5
            with:
              python-version: "3.11"
              # Issue ref: https://github.com/actions/setup-python/issues/436
              # cache: "pip"
              # cache-dependency-path: pyproject.toml
          - uses: actions/cache@v4
            id: cache
            with:
              path: ${{ env.pythonLocation }}
    Others
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 4.4K bytes
    - Viewed (1)
  9. docs_src/settings/app03_an/main.py

    from functools import lru_cache
    from typing import Annotated
    
    from fastapi import Depends, FastAPI
    
    from . import config
    
    app = FastAPI()
    
    
    @lru_cache
    def get_settings():
        return config.Settings()
    
    
    @app.get("/info")
    async def info(settings: Annotated[config.Settings, Depends(get_settings)]):
        return {
            "app_name": settings.app_name,
            "admin_email": settings.admin_email,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 451 bytes
    - Viewed (0)
  10. docs/en/docs/advanced/settings.md

    `@lru_cache` is part of `functools` which is part of Python's standard library, you can read more about it in the <a href="https://docs.python.org/3/library/functools.html#functools.lru_cache" class="external-link" target="_blank">Python docs for `@lru_cache`</a>.
    
    ## Recap
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 15.7K bytes
    - Viewed (0)
Back to top