Execution after timeout
Stay organized with collections
Save and categorize content based on your preferences.
Sample that demonstrates code that should (but won't) execute after a GCF call times out.
Code sample
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],[],[[["\u003cp\u003eThis page demonstrates code samples in Go, Java, Node.js, and Python that are designed to execute for two minutes, showcasing how Cloud Functions might time out before completion.\u003c/p\u003e\n"],["\u003cp\u003eThe provided code examples highlight the potential for a function's execution to be interrupted by a timeout if the set duration is less than two minutes, as each sample includes a two-minute delay.\u003c/p\u003e\n"],["\u003cp\u003eThe samples use \u003ccode\u003etime.Sleep\u003c/code\u003e in Go, \u003ccode\u003eTimeUnit.MINUTES.sleep\u003c/code\u003e in Java, \u003ccode\u003esetTimeout\u003c/code\u003e in Node.js, and \u003ccode\u003etime.sleep\u003c/code\u003e in Python, to simulate a long-running process that could be cut short by a timeout.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication for Cloud Run functions is achieved through setting up Application Default Credentials, with a link provided for further instructions on local development environment authentication.\u003c/p\u003e\n"],["\u003cp\u003eThe content directs users to the Google Cloud sample browser for further exploration of code samples across various Google Cloud products.\u003c/p\u003e\n"]]],[],null,[]]