EnsureStatusCode and a comment note

This commit is contained in:
Raymond 2021-10-10 21:38:28 -04:00
parent 6a8256b827
commit d2fb9abf80

View file

@ -75,9 +75,12 @@ namespace Dalamud.Plugin.Internal
{
Log.Information($"Fetching repo: {this.PluginMasterUrl}");
using var client = new HttpClient();
using var response = await client.GetAsync(this.PluginMasterUrl + "?" + DateTime.Now.Ticks);
var data = await response.Content.ReadAsStringAsync();
// ?ticks causes a cache invalidation. Get a fresh repo every time.
using var response = await client.GetAsync(this.PluginMasterUrl + "?" + DateTime.Now.Ticks);
response.EnsureSuccessStatusCode();
var data = await response.Content.ReadAsStringAsync();
var pluginMaster = JsonConvert.DeserializeObject<List<RemotePluginManifest>>(data);
if (pluginMaster == null)