[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-12-22。"],[[["\u003cp\u003eFunctions have a default timeout of 60 seconds, which can be adjusted during deployment.\u003c/p\u003e\n"],["\u003cp\u003eThe maximum timeout duration for a function is nine minutes (540 seconds).\u003c/p\u003e\n"],["\u003cp\u003eWhen a function exceeds its timeout, an HTTP error (typically 408) is returned, and execution stops.\u003c/p\u003e\n"],["\u003cp\u003eTimeout duration can be set or modified during deployment or through redeployment, using either the Google Cloud CLI or the Google Cloud console.\u003c/p\u003e\n"]]],[],null,["# Function timeout (1st gen)\n==========================\n\nIf a function runs for too long, the system takes steps to terminate or\nthrottle it. This timeout period defaults to 60 seconds, but you can extend or\nreduce it when you deploy the function. The maximum timeout duration is nine\nminutes (540 seconds).\n\nWhen function execution reaches its timeout, a response message with an HTTP\nerror status, generally 408, is immediately returned to the caller; function\nexecution is halted.\n\nSet a timeout duration\n----------------------\n\nYou can set a function's timeout duration at deployment using the\nGoogle Cloud CLI or the Google Cloud console. \n\n### gcloud\n\nIf you are deploying using the gcloud CLI, use the\n[`--timeout`](/sdk/gcloud/reference/functions/deploy#--timeout) flag: \n\n```sh\ngcloud functions deploy YOUR_FUNCTION_NAME --no-gen2 --timeout=TIMEOUT_DURATION ...\n```\n\nTo edit an existing timeout duration with Google Cloud CLI, redeploy the\nfunction with a new timeout value.\n\n### Console\n\nTo set the timeout duration during function creation in the\nGoogle Cloud console:\n\n1. Go to the [Cloud Run functions Overview page](https://console.cloud.google.com/functions/list) in the Google Cloud console.\n2. Click **Create function**.\n3. Fill in the required fields for your function.\n4. Expand the **Runtime, build...** section at the end of the page and click the **Runtime** tab.\n5. In the **Timeout** field, enter a number of seconds.\n\n To edit an existing timeout duration in Google Cloud console, on the functions\n overview page click the name of the function to go to its details\n page. On the details page click **Edit** , expand the **Runtime, build...**\n section, and click the **Runtime** tab, where you can directly edit the\n value in the **Timeout** field."]]