mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 13:14:17 +01:00
pluginRepository task exhaustion fix
This commit is contained in:
parent
58324429e7
commit
013805c19c
1 changed files with 4 additions and 5 deletions
|
|
@ -30,8 +30,7 @@ namespace Dalamud.Plugin.Internal
|
||||||
this.IsThirdParty = pluginMasterUrl != DalamudPluginsMasterUrl;
|
this.IsThirdParty = pluginMasterUrl != DalamudPluginsMasterUrl;
|
||||||
this.IsEnabled = isEnabled;
|
this.IsEnabled = isEnabled;
|
||||||
|
|
||||||
// No need to wait for this
|
this.ReloadPluginMasterAsync();
|
||||||
Task.Run(this.ReloadPluginMasterAsync);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -73,12 +72,12 @@ namespace Dalamud.Plugin.Internal
|
||||||
this.State = PluginRepositoryState.InProgress;
|
this.State = PluginRepositoryState.InProgress;
|
||||||
this.PluginMaster = new List<RemotePluginManifest>().AsReadOnly();
|
this.PluginMaster = new List<RemotePluginManifest>().AsReadOnly();
|
||||||
|
|
||||||
return Task.Run(() =>
|
return Task.Run(async () =>
|
||||||
{
|
{
|
||||||
Log.Information($"Fetching repo: {this.PluginMasterUrl}");
|
Log.Information($"Fetching repo: {this.PluginMasterUrl}");
|
||||||
using var client = new HttpClient();
|
using var client = new HttpClient();
|
||||||
using var response = client.GetAsync(this.PluginMasterUrl).Result;
|
using var response = await client.GetAsync(this.PluginMasterUrl);
|
||||||
var data = response.Content.ReadAsStringAsync().Result;
|
var data = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
var pluginMaster = JsonConvert.DeserializeObject<List<RemotePluginManifest>>(data);
|
var pluginMaster = JsonConvert.DeserializeObject<List<RemotePluginManifest>>(data);
|
||||||
pluginMaster.Sort((pm1, pm2) => pm1.Name.CompareTo(pm2.Name));
|
pluginMaster.Sort((pm1, pm2) => pm1.Name.CompareTo(pm2.Name));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue