Sped up the refresh of package updates by igor84 · Pull Request #718 · GlitchEnzo/NuGetForUnity (original) (raw)

Conversation

@igor84

We added additional Artifactory source that has a lot of packages with a lot of versions and opening Nuget window started taking 20s. I moved fetching updates when window is opened to a background thread so that window is opened much faster. I also sped up the fetching of package updates by using Task.WhenAll to fetch them all in parallel instead of one by one. In case window is closed while fetching is in progress CancellationToken is used to cancel it all.

@igor84

popara96

JoC0de

@igor84

@igor84

@igor84

I had to add try catch in GetUpdates Task.Run because Unity would sometimes get stuck if OperationInterruptedException was thrown within.
I also had to remove setting ServicePointManager.DefaultConnectionLimit because it does nothing unless set very early after Domain reload. For example it works when I set it from a method marked with [UnityEditor.InitializeOnLoadMethod] attribute. I found that documentation for it says "Set your preferred value once, when the AppDomain loads".

JoC0de

@JoC0de JoC0de deleted the update-refresh-speedup branch

May 24, 2025 08:55

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})