diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs index 1526b1c..d380da8 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs | |||
@@ -60,7 +60,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
60 | Completed, | 60 | Completed, |
61 | Aborted | 61 | Aborted |
62 | }; | 62 | }; |
63 | 63 | ||
64 | /// <value> | 64 | /// <value> |
65 | /// Timeout threshold if we still need assets or missing asset notifications but have stopped receiving them | 65 | /// Timeout threshold if we still need assets or missing asset notifications but have stopped receiving them |
66 | /// from the asset service | 66 | /// from the asset service |
@@ -71,14 +71,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
71 | /// If a timeout does occur, limit the amount of UUID information put to the console. | 71 | /// If a timeout does occur, limit the amount of UUID information put to the console. |
72 | /// </value> | 72 | /// </value> |
73 | protected const int MAX_UUID_DISPLAY_ON_TIMEOUT = 3; | 73 | protected const int MAX_UUID_DISPLAY_ON_TIMEOUT = 3; |
74 | 74 | ||
75 | protected System.Timers.Timer m_requestCallbackTimer; | 75 | protected System.Timers.Timer m_requestCallbackTimer; |
76 | 76 | ||
77 | /// <value> | 77 | /// <value> |
78 | /// State of this request | 78 | /// State of this request |
79 | /// </value> | 79 | /// </value> |
80 | private RequestState m_requestState = RequestState.Initial; | 80 | private RequestState m_requestState = RequestState.Initial; |
81 | 81 | ||
82 | /// <value> | 82 | /// <value> |
83 | /// uuids to request | 83 | /// uuids to request |
84 | /// </value> | 84 | /// </value> |
@@ -93,7 +93,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
93 | /// List of assets that were found. This will be passed back to the requester. | 93 | /// List of assets that were found. This will be passed back to the requester. |
94 | /// </value> | 94 | /// </value> |
95 | protected List<UUID> m_foundAssetUuids = new List<UUID>(); | 95 | protected List<UUID> m_foundAssetUuids = new List<UUID>(); |
96 | 96 | ||
97 | /// <value> | 97 | /// <value> |
98 | /// Maintain a list of assets that could not be found. This will be passed back to the requester. | 98 | /// Maintain a list of assets that could not be found. This will be passed back to the requester. |
99 | /// </value> | 99 | /// </value> |
@@ -109,16 +109,16 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
109 | /// </value> | 109 | /// </value> |
110 | protected IAssetService m_assetService; | 110 | protected IAssetService m_assetService; |
111 | protected IUserAccountService m_userAccountService; | 111 | protected IUserAccountService m_userAccountService; |
112 | protected UUID m_scopeID; // the grid ID | 112 | protected UUID m_scopeID; // the grid ID |
113 | 113 | ||
114 | protected AssetsArchiver m_assetsArchiver; | 114 | protected AssetsArchiver m_assetsArchiver; |
115 | 115 | ||
116 | protected Dictionary<string, object> m_options; | 116 | protected Dictionary<string, object> m_options; |
117 | 117 | ||
118 | protected internal AssetsRequest( | 118 | protected internal AssetsRequest( |
119 | AssetsArchiver assetsArchiver, IDictionary<UUID, sbyte> uuids, | 119 | AssetsArchiver assetsArchiver, IDictionary<UUID, sbyte> uuids, |
120 | IAssetService assetService, IUserAccountService userService, | 120 | IAssetService assetService, IUserAccountService userService, |
121 | UUID scope, Dictionary<string, object> options, | 121 | UUID scope, Dictionary<string, object> options, |
122 | AssetsRequestCallback assetsRequestCallback) | 122 | AssetsRequestCallback assetsRequestCallback) |
123 | { | 123 | { |
124 | m_assetsArchiver = assetsArchiver; | 124 | m_assetsArchiver = assetsArchiver; |
@@ -142,7 +142,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
142 | protected internal void Execute() | 142 | protected internal void Execute() |
143 | { | 143 | { |
144 | m_requestState = RequestState.Running; | 144 | m_requestState = RequestState.Running; |
145 | 145 | ||
146 | m_log.DebugFormat("[ARCHIVER]: AssetsRequest executed looking for {0} possible assets", m_repliesRequired); | 146 | m_log.DebugFormat("[ARCHIVER]: AssetsRequest executed looking for {0} possible assets", m_repliesRequired); |
147 | 147 | ||
148 | // We can stop here if there are no assets to fetch | 148 | // We can stop here if there are no assets to fetch |
@@ -180,7 +180,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
180 | timedOut = false; | 180 | timedOut = false; |
181 | return; | 181 | return; |
182 | } | 182 | } |
183 | 183 | ||
184 | m_requestState = RequestState.Aborted; | 184 | m_requestState = RequestState.Aborted; |
185 | } | 185 | } |
186 | 186 | ||
@@ -196,24 +196,24 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
196 | { | 196 | { |
197 | uuids.Remove(uuid); | 197 | uuids.Remove(uuid); |
198 | } | 198 | } |
199 | 199 | ||
200 | foreach (UUID uuid in m_notFoundAssetUuids) | 200 | foreach (UUID uuid in m_notFoundAssetUuids) |
201 | { | 201 | { |
202 | uuids.Remove(uuid); | 202 | uuids.Remove(uuid); |
203 | } | 203 | } |
204 | 204 | ||
205 | m_log.ErrorFormat( | 205 | m_log.ErrorFormat( |
206 | "[ARCHIVER]: Asset service failed to return information about {0} requested assets", uuids.Count); | 206 | "[ARCHIVER]: Asset service failed to return information about {0} requested assets", uuids.Count); |
207 | 207 | ||
208 | int i = 0; | 208 | int i = 0; |
209 | foreach (UUID uuid in uuids) | 209 | foreach (UUID uuid in uuids) |
210 | { | 210 | { |
211 | m_log.ErrorFormat("[ARCHIVER]: No information about asset {0} received", uuid); | 211 | m_log.ErrorFormat("[ARCHIVER]: No information about asset {0} received", uuid); |
212 | 212 | ||
213 | if (++i >= MAX_UUID_DISPLAY_ON_TIMEOUT) | 213 | if (++i >= MAX_UUID_DISPLAY_ON_TIMEOUT) |
214 | break; | 214 | break; |
215 | } | 215 | } |
216 | 216 | ||
217 | if (uuids.Count > MAX_UUID_DISPLAY_ON_TIMEOUT) | 217 | if (uuids.Count > MAX_UUID_DISPLAY_ON_TIMEOUT) |
218 | m_log.ErrorFormat( | 218 | m_log.ErrorFormat( |
219 | "[ARCHIVER]: (... {0} more not shown)", uuids.Count - MAX_UUID_DISPLAY_ON_TIMEOUT); | 219 | "[ARCHIVER]: (... {0} more not shown)", uuids.Count - MAX_UUID_DISPLAY_ON_TIMEOUT); |
@@ -251,24 +251,24 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
251 | public void AssetRequestCallback(string id, object sender, AssetBase asset) | 251 | public void AssetRequestCallback(string id, object sender, AssetBase asset) |
252 | { | 252 | { |
253 | Culture.SetCurrentCulture(); | 253 | Culture.SetCurrentCulture(); |
254 | 254 | ||
255 | try | 255 | try |
256 | { | 256 | { |
257 | lock (this) | 257 | lock (this) |
258 | { | 258 | { |
259 | //m_log.DebugFormat("[ARCHIVER]: Received callback for asset {0}", id); | 259 | //m_log.DebugFormat("[ARCHIVER]: Received callback for asset {0}", id); |
260 | 260 | ||
261 | m_requestCallbackTimer.Stop(); | 261 | m_requestCallbackTimer.Stop(); |
262 | 262 | ||
263 | if ((m_requestState == RequestState.Aborted) || (m_requestState == RequestState.Completed)) | 263 | if ((m_requestState == RequestState.Aborted) || (m_requestState == RequestState.Completed)) |
264 | { | 264 | { |
265 | m_log.WarnFormat( | 265 | m_log.WarnFormat( |
266 | "[ARCHIVER]: Received information about asset {0} while in state {1}. Ignoring.", | 266 | "[ARCHIVER]: Received information about asset {0} while in state {1}. Ignoring.", |
267 | id, m_requestState); | 267 | id, m_requestState); |
268 | 268 | ||
269 | return; | 269 | return; |
270 | } | 270 | } |
271 | 271 | ||
272 | if (asset != null) | 272 | if (asset != null) |
273 | { | 273 | { |
274 | // m_log.DebugFormat("[ARCHIVER]: Writing asset {0}", id); | 274 | // m_log.DebugFormat("[ARCHIVER]: Writing asset {0}", id); |
@@ -281,7 +281,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
281 | // m_log.DebugFormat("[ARCHIVER]: Recording asset {0} as not found", id); | 281 | // m_log.DebugFormat("[ARCHIVER]: Recording asset {0} as not found", id); |
282 | m_notFoundAssetUuids.Add(new UUID(id)); | 282 | m_notFoundAssetUuids.Add(new UUID(id)); |
283 | } | 283 | } |
284 | 284 | ||
285 | if (m_foundAssetUuids.Count + m_notFoundAssetUuids.Count >= m_repliesRequired) | 285 | if (m_foundAssetUuids.Count + m_notFoundAssetUuids.Count >= m_repliesRequired) |
286 | { | 286 | { |
287 | m_requestState = RequestState.Completed; | 287 | m_requestState = RequestState.Completed; |
@@ -294,8 +294,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
294 | "[ARCHIVER]: Successfully added {0} assets ({1} assets not found but these may be expected invalid references)", | 294 | "[ARCHIVER]: Successfully added {0} assets ({1} assets not found but these may be expected invalid references)", |
295 | m_foundAssetUuids.Count, m_notFoundAssetUuids.Count); | 295 | m_foundAssetUuids.Count, m_notFoundAssetUuids.Count); |
296 | 296 | ||
297 | 297 | ||
298 | // We want to stop using the asset cache thread asap | 298 | // We want to stop using the asset cache thread asap |
299 | // as we now need to do the work of producing the rest of the archive | 299 | // as we now need to do the work of producing the rest of the archive |
300 | WorkManager.RunInThread(PerformAssetsRequestCallback, false, "Archive Assets Request Callback"); | 300 | WorkManager.RunInThread(PerformAssetsRequestCallback, false, "Archive Assets Request Callback"); |
301 | } | 301 | } |