diff options
Diffstat (limited to 'OpenSim/Services')
-rw-r--r-- | OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 048ba69..99119d3 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | |||
@@ -51,6 +51,7 @@ namespace OpenSim.Services.Connectors | |||
51 | private string m_ServerURI = String.Empty; | 51 | private string m_ServerURI = String.Empty; |
52 | private IImprovedAssetCache m_Cache = null; | 52 | private IImprovedAssetCache m_Cache = null; |
53 | private int m_retryCounter; | 53 | private int m_retryCounter; |
54 | private bool m_inRetries; | ||
54 | private List<AssetBase>[] m_sendRetries = new List<AssetBase>[MAXSENDRETRIESLEN]; | 55 | private List<AssetBase>[] m_sendRetries = new List<AssetBase>[MAXSENDRETRIESLEN]; |
55 | private System.Timers.Timer m_retryTimer; | 56 | private System.Timers.Timer m_retryTimer; |
56 | private int m_maxAssetRequestConcurrency = 30; | 57 | private int m_maxAssetRequestConcurrency = 30; |
@@ -114,7 +115,7 @@ namespace OpenSim.Services.Connectors | |||
114 | 115 | ||
115 | m_retryTimer = new System.Timers.Timer(); | 116 | m_retryTimer = new System.Timers.Timer(); |
116 | m_retryTimer.Elapsed += new ElapsedEventHandler(retryCheck); | 117 | m_retryTimer.Elapsed += new ElapsedEventHandler(retryCheck); |
117 | m_retryTimer.AutoReset = false; | 118 | m_retryTimer.AutoReset = true; |
118 | m_retryTimer.Interval = 60000; | 119 | m_retryTimer.Interval = 60000; |
119 | 120 | ||
120 | Uri serverUri = new Uri(m_ServerURI); | 121 | Uri serverUri = new Uri(m_ServerURI); |
@@ -168,6 +169,13 @@ namespace OpenSim.Services.Connectors | |||
168 | 169 | ||
169 | protected void retryCheck(object source, ElapsedEventArgs e) | 170 | protected void retryCheck(object source, ElapsedEventArgs e) |
170 | { | 171 | { |
172 | lock(m_sendRetries) | ||
173 | { | ||
174 | if(m_inRetries) | ||
175 | return; | ||
176 | m_inRetries = true; | ||
177 | } | ||
178 | |||
171 | m_retryCounter++; | 179 | m_retryCounter++; |
172 | if(m_retryCounter >= 61 ) // avoid overflow 60 is max in use below | 180 | if(m_retryCounter >= 61 ) // avoid overflow 60 is max in use below |
173 | m_retryCounter = 1; | 181 | m_retryCounter = 1; |
@@ -218,8 +226,10 @@ namespace OpenSim.Services.Connectors | |||
218 | 226 | ||
219 | lock(m_sendRetries) | 227 | lock(m_sendRetries) |
220 | { | 228 | { |
221 | if(inUse > 0 && !m_retryTimer.Enabled) | 229 | if(inUse == 0 ) |
222 | m_retryTimer.Start(); | 230 | m_retryTimer.Stop(); |
231 | |||
232 | m_inRetries = false; | ||
223 | } | 233 | } |
224 | } | 234 | } |
225 | 235 | ||
@@ -512,8 +522,7 @@ namespace OpenSim.Services.Connectors | |||
512 | m_queue.Add(asset); | 522 | m_queue.Add(asset); |
513 | m_log.WarnFormat("[Assets] Upload failed: {0} type {1} will retry later", | 523 | m_log.WarnFormat("[Assets] Upload failed: {0} type {1} will retry later", |
514 | asset.ID.ToString(), asset.Type.ToString()); | 524 | asset.ID.ToString(), asset.Type.ToString()); |
515 | if(!m_retryTimer.Enabled) | 525 | m_retryTimer.Start(); |
516 | m_retryTimer.Start(); | ||
517 | } | 526 | } |
518 | } | 527 | } |
519 | else | 528 | else |