unity-renderer icon indicating copy to clipboard operation
unity-renderer copied to clipboard

chore: reduce timeouts when necessary

Open dalkia opened this issue 3 years ago • 1 comments

What does this PR change?

Webrequests are being done using the Environment.i.platform.webRequest variable. Using the Get method, you can create a new web request.

The default timeout time for this request is 0 (no timeout); and there are cases in which 15, 10, and 300 are set. (WebRequestLoader.cs, DCLAvatarTexture.cs, GifDecodeProcessor.cs)

The cases in which is 5000 are in class WearableFetchingHelper.cs, in methods:

GetThirdPartyCollections() => Worst time: 4.348743 Best time: 0.3467484 EnsureCollectionsData() => Not longer being used, since the collections data is now controller by the CatalogController.cs. This method is used for the instantiating of the bots. Worst time: 0.6884918 Best time: 1.05 GetWearableItems() => Not longer being used, since the collections data is now controller by the CatalogController.cs. This method is used for the instantiating of the bots. Worst time: 0.1983185 Best time: 0.19

These were the only scenarios in which the 5000 times was used. Keep in mind that the default browser time may get into place, setting the maximum time at 300 seconds (https://stackoverflow.com/questions/5798707/browser-timeouts)

Seems safe to move the timeouts to 60, so we give a relatively big buffer in case something was not contemplated.

How to test the changes?

No testing needed

Our Code Review Standards

https://github.com/decentraland/unity-renderer/blob/master/docs/code-review-standards.md

dalkia avatar Sep 07 '22 17:09 dalkia

After the CI passes:

github-actions[bot] avatar Sep 07 '22 17:09 github-actions[bot]