Skip to content

Conversation

@igor84
Copy link
Collaborator

@igor84 igor84 commented May 14, 2025

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
Copy link
Collaborator Author

igor84 commented May 20, 2025

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".

@igor84 igor84 requested a review from JoC0de May 23, 2025 14:22
@JoC0de JoC0de merged commit a22299e into master May 24, 2025
8 checks passed
@JoC0de JoC0de deleted the update-refresh-speedup branch May 24, 2025 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants