หมดเวลา
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
แต่ละบริการมีนโยบายระยะหมดเวลาและลองใหม่เริ่มต้นที่ระบุไว้ในไฟล์ client.rb
ของบริการนั้น ลองดูตัวอย่างจาก
client.rb
บริการแคมเปญ แล้วหาเมธอด self.configure
ค่าเริ่มต้นเหล่านี้สามารถลบล้างได้ในบริการหลังจากที่สร้างอินสแตนซ์แล้ว โดยทําตามตัวอย่างใน set_custom_client_timeouts.rb
คุณกําหนดระยะหมดเวลาให้ใหญ่ได้เท่าที่ต้องการ แต่การตอบกลับที่ใช้เวลานานกว่า 2 ชั่วโมงอาจส่งผลให้เกิดข้อผิดพลาด DEADLINE_EXCEEDED
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-26 UTC
[null,null,["อัปเดตล่าสุด 2025-08-26 UTC"],[[["\u003cp\u003eEach Google Ads API service has a default timeout and retry policy defined in its \u003ccode\u003eclient.rb\u003c/code\u003e file.\u003c/p\u003e\n"],["\u003cp\u003eThese defaults can be overridden after service instantiation using the approach demonstrated in the \u003ccode\u003eset_custom_client_timeouts.rb\u003c/code\u003e example.\u003c/p\u003e\n"],["\u003cp\u003eWhile custom timeouts can be set to any duration, responses exceeding two hours might lead to a \u003ccode\u003eDEADLINE_EXCEEDED\u003c/code\u003e error.\u003c/p\u003e\n"]]],[],null,["# Timeouts\n\nEach service comes with a default timeout and retry policy specified in that\nservice's `client.rb` file. For an example, take a look at the campaign\nservice's\n[`client.rb`](https://github.com/googleads/google-ads-ruby/blob/main/lib/google/ads/google_ads/v21/services/campaign_service/client.rb)\nand find the `self.configure` method.\n\nThese defaults can be overridden on a service after you instantiate it. To do\nso, follow the example in\n[`set_custom_client_timeouts.rb`](https://github.com/googleads/google-ads-ruby/blob/main/examples/misc/set_custom_client_timeouts.rb).\n\nYou can set a timeout as large as you like, but responses that take over two\nhours might result in a\n[`DEADLINE_EXCEEDED`](/google-ads/api/reference/rpc/v21/InternalErrorEnum.InternalError) error."]]