diff --git a/src/UniGetUI.PackageEngine.PackageManagerClasses/Manager/PackageManager.cs b/src/UniGetUI.PackageEngine.PackageManagerClasses/Manager/PackageManager.cs index ef5bb642d..c9e214deb 100644 --- a/src/UniGetUI.PackageEngine.PackageManagerClasses/Manager/PackageManager.cs +++ b/src/UniGetUI.PackageEngine.PackageManagerClasses/Manager/PackageManager.cs @@ -147,7 +147,7 @@ public async Task FindPackages(string query) if (!IsReady()) { Logger.Warn($"Manager {Name} is disabled but yet FindPackages was called"); return []; }; try { - Package[] packages = await FindPackages_UnSafe(query); + Package[] packages = await FindPackages_UnSafe(query).WaitAsync(TimeSpan.FromSeconds(60)); for (int i = 0; i < packages.Length; i++) { packages[i] = PackageFactory.GetAvailablePackageIfRepeated(packages[i]); @@ -174,8 +174,8 @@ public async Task GetAvailableUpdates() if (!IsReady()) { Logger.Warn($"Manager {Name} is disabled but yet GetAvailableUpdates was called"); return []; }; try { - await RefreshPackageIndexes(); - Package[] packages = await GetAvailableUpdates_UnSafe(); + await RefreshPackageIndexes().WaitAsync(TimeSpan.FromSeconds(60)); + Package[] packages = await GetAvailableUpdates_UnSafe().WaitAsync(TimeSpan.FromSeconds(60)); for (int i = 0; i < packages.Length; i++) packages[i] = PackageFactory.GetUpgradablePackageIfRepeated(packages[i]); Logger.Info($"Found {packages.Length} available updates from {Name}"); @@ -199,7 +199,7 @@ public async Task GetInstalledPackages() if (!IsReady()) { Logger.Warn($"Manager {Name} is disabled but yet GetInstalledPackages was called"); return []; }; try { - Package[] packages = await GetInstalledPackages_UnSafe(); + Package[] packages = await GetInstalledPackages_UnSafe().WaitAsync(TimeSpan.FromSeconds(60)); for (int i = 0; i < packages.Length; i++) packages[i] = PackageFactory.GetInstalledPackageIfRepeated(packages[i]); Logger.Info($"Found {packages.Length} installed packages from {Name}"); @@ -362,7 +362,7 @@ public virtual async Task GetSources() try { AssertSourceCompatibility("GetSources"); - var result = await SourceProvider.GetSources(); + var result = await SourceProvider.GetSources().WaitAsync(TimeSpan.FromSeconds(60)); Logger.Debug($"Loaded {result.Length} sources for manager {Name}"); return result; }