Add a MaxRetries option to the inventory connector.

If clustered services are used, another try would go to another server
and may succeed.
melanie
Melanie Thielker 2016-12-29 16:29:44 +00:00
parent 07b48fd58c
commit e0b5135010
2 changed files with 16 additions and 2 deletions

View File

@ -54,6 +54,8 @@ namespace OpenSim.Services.Connectors
private string m_ServerURI = String.Empty;
private int m_maxRetries = 0;
/// <summary>
/// Timeout for remote requests.
/// </summary>
@ -100,6 +102,7 @@ namespace OpenSim.Services.Connectors
m_ServerURI = serviceURI;
m_requestTimeoutSecs = config.GetInt("RemoteRequestTimeout", m_requestTimeoutSecs);
m_maxRetries = config.GetInt("MaxRetries", m_maxRetries);
StatsManager.RegisterStat(
new Stat(
@ -700,10 +703,20 @@ namespace OpenSim.Services.Connectors
RequestsMade++;
string reply
= SynchronousRestFormsRequester.MakeRequest(
string reply = String.Empty;
int retries = 0;
do
{
reply = SynchronousRestFormsRequester.MakeRequest(
"POST", m_ServerURI + "/xinventory",
ServerUtils.BuildQueryString(sendData), m_requestTimeoutSecs, m_Auth);
if (reply != String.Empty)
break;
retries++;
} while (retries <= m_maxRetries);
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(
reply);

View File

@ -85,6 +85,7 @@
; Change this to your grid-wide inventory server
;
InventoryServerURI = "${Const|BaseURL}:${Const|PrivatePort}"
;MaxRetries = 0
[GridInfo]
;