Change the retry on error
This procedure shows you how to change the variables related to the retry attempts on network error. It involves setting network theme variables.
About this task
- In the $theme-network-retry-on-error variable,
provide a list of HTTP status codes. If you set this variable to the HTTP
status codes
[502, 504]
, when the application receives a 502 or 504 code in response to a request, the GBC will send the HTTP request again. For information on the full range of HTTP status codes see RFC 2616. - The number of times the request can be resent is set by the $theme-network-retry-timeout variable.
The default value is
[1, 1, 1, 2, 2, 2, 4, 4, 4]
. For more information on the default value, see HTTP retries.This feature increases the time required for the detection of invalid hosts or dead servers. For example, if you set this variable to
[1, 5, 10]
, the GBC will try a maximum of 3 times to send the HTTP request. The first retry is after 1 second, then if it still fails to get a response, it retries after 5 seconds, and retries again after 10 seconds.
Before you begin
This procedure assumes you are comfortable updating theme parts and themes. For the basic principles behind themes and theme parts, see How customization works. For instructions about adding and modifying themes and theme parts, see Working with themes. For information about the underlying GBC infrastructure and its components, see Theme reference.
In this example, you will customize the GBC to resend requests on network error before stopping the application.