Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for timed_out (0.18 sec)

  1. docs_src/custom_request_and_route/tutorial003.py

    import time
    from typing import Callable
    
    from fastapi import APIRouter, FastAPI, Request, Response
    from fastapi.routing import APIRoute
    
    
    class TimedRoute(APIRoute):
        def get_route_handler(self) -> Callable:
            original_route_handler = super().get_route_handler()
    
            async def custom_route_handler(request: Request) -> Response:
                before = time.time()
                response: Response = await original_route_handler(request)
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 1K bytes
    - Viewed (0)
  2. docs/zh/docs/advanced/custom-request-and-route.md

    ```
    
    ## 在路由中自定义 `APIRoute` 类
    
    您还可以设置 `APIRoute` 的 `route_class` 参数:
    
    ```Python hl_lines="26"
    {!../../../docs_src/custom_request_and_route/tutorial003.py!}
    ```
    
    本例中,*路径操作*下的 `router` 使用自定义的 `TimedRoute` 类,并在响应中包含输出生成响应时间的 `X-Response-Time` 响应头:
    
    ```Python hl_lines="13-20"
    {!../../../docs_src/custom_request_and_route/tutorial003.py!}
    Plain Text
    - Registered: Sun Mar 31 07:19:09 GMT 2024
    - Last Modified: Sat Mar 30 22:45:40 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  3. .github/actions/notify-translations/app/main.py

            "discussion_id": discussion_id,
            "comment_id": comment_id,
            "body": body,
        }
        response = httpx.post(
            github_graphql_url,
            headers=headers,
            timeout=settings.httpx_timeout,
            json={"query": query, "variables": variables, "operationName": "Q"},
        )
        if response.status_code != 200:
            logging.error(
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Sep 27 23:01:46 GMT 2023
    - 12.4K bytes
    - Viewed (0)
  4. .github/actions/people/app/main.py

        # keep it here for simplicity
        variables = {"after": after, "category_id": category_id}
        response = httpx.post(
            github_graphql_url,
            headers=headers,
            timeout=settings.httpx_timeout,
            json={"query": query, "variables": variables, "operationName": "Q"},
        )
        if response.status_code != 200:
            logging.error(
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 17:38:21 GMT 2024
    - 19.2K bytes
    - Viewed (1)
  5. docs/en/docs/how-to/custom-request-and-route.md

    ```Python hl_lines="26"
    {!../../../docs_src/custom_request_and_route/tutorial003.py!}
    ```
    
    In this example, the *path operations* under the `router` will use the custom `TimedRoute` class, and will have an extra `X-Response-Time` header in the response with the time it took to generate the response:
    
    ```Python hl_lines="13-20"
    {!../../../docs_src/custom_request_and_route/tutorial003.py!}
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Mar 31 23:52:53 GMT 2024
    - 4.4K bytes
    - Viewed (0)
  6. docs/em/docs/how-to/custom-request-and-route.md

    ```
    
    ## 🛃 `APIRoute` 🎓 📻
    
    👆 💪 ⚒ `route_class` 🔢 `APIRouter`:
    
    ```Python hl_lines="26"
    {!../../../docs_src/custom_request_and_route/tutorial003.py!}
    ```
    
    👉 🖼, *➡ 🛠️* 🔽 `router` 🔜 ⚙️ 🛃 `TimedRoute` 🎓, & 🔜 ✔️ ➕ `X-Response-Time` 🎚 📨 ⏮️ 🕰 ⚫️ ✊ 🏗 📨:
    
    ```Python hl_lines="13-20"
    {!../../../docs_src/custom_request_and_route/tutorial003.py!}
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 3.6K bytes
    - Viewed (0)
  7. docs/en/docs/release-notes.md

    * 🐛 Fix FastAPI People GitHub Action: set HTTPX timeout for GraphQL query request. PR [#5222](https://github.com/tiangolo/fastapi/pull/5222) by [@iudeen](https://github.com/iudeen).
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri May 03 23:25:42 GMT 2024
    - 388.1K bytes
    - Viewed (1)
  8. docs/de/docs/how-to/custom-request-and-route.md

    ```Python hl_lines="26"
    {!../../../docs_src/custom_request_and_route/tutorial003.py!}
    ```
    
    In diesem Beispiel verwenden die *Pfadoperationen* unter dem `router` die benutzerdefinierte `TimedRoute`-Klasse und haben in der Response einen zusätzlichen `X-Response-Time`-Header mit der Zeit, die zum Generieren der Response benötigt wurde:
    
    ```Python hl_lines="13-20"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 18:18:23 GMT 2024
    - 5.2K bytes
    - Viewed (0)
  9. docs/en/docs/js/termynal.js

    			if (percent>progressPercent) {
    				break;
    			}
            }
        }
    
        /**
         * Helper function for animation delays, called with `await`.
         * @param {number} time - Timeout, in ms.
         */
        _wait(time) {
            return new Promise(resolve => setTimeout(resolve, time));
        }
    
        /**
         * Converts line data objects into line elements.
         *
    JavaScript
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 12 00:06:16 GMT 2022
    - 9.3K bytes
    - Viewed (0)
  10. docs_src/nosql_databases/tutorial001.py

        cluster = Cluster(
            "couchbase://couchbasehost:8091?fetch_mutation_tokens=1&operation_timeout=30&n1ql_timeout=300"
        )
        authenticator = PasswordAuthenticator("username", "password")
        cluster.authenticate(authenticator)
        bucket: Bucket = cluster.open_bucket("bucket_name", lockmode=LOCKMODE_WAIT)
        bucket.timeout = 30
        bucket.n1ql_timeout = 300
        return bucket
    
    
    class User(BaseModel):
        username: str
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 1.3K bytes
    - Viewed (0)
Back to top