Czasy oczekiwania
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Każda usługa ma domyślny czas oczekiwania i zasady dotyczące ponawiania prób określone w pliku client.rb
tej usługi. Przykład: otwórz usługę client.rb
usługi kampanii i znajdź metodę self.configure
.
Po utworzeniu instancji możesz zastąpić te ustawienia domyślne. Aby to zrobić, skorzystaj z przykładu w set_custom_client_timeouts.rb
.
Możesz ustawić czas oczekiwania na tyle, na ile chcesz, ale odpowiedzi trwające ponad 2 godziny mogą spowodować błąd DEADLINE_EXCEEDED
.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-09-05 UTC.
[null,null,["Ostatnia aktualizacja: 2025-09-05 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."]]