Use a stream instead of putting the entire string in memory
This commit is contained in:
parent
af3cc81180
commit
5f089fb01f
|
|
@ -52,7 +52,7 @@ namespace AS1024.GeoFeed.Core.GeoFeedProviders
|
|||
{
|
||||
break;
|
||||
}
|
||||
string stringResult = await result.Content.ReadAsStringAsync();
|
||||
var stringResult = await result.Content.ReadAsStreamAsync();
|
||||
jsonData = DeserializeJsonData(stringResult);
|
||||
|
||||
if (jsonData?.Results == null || jsonData.Results.Count == 0)
|
||||
|
|
@ -93,7 +93,7 @@ namespace AS1024.GeoFeed.Core.GeoFeedProviders
|
|||
return geoFeed;
|
||||
}
|
||||
|
||||
protected virtual NetboxData? DeserializeJsonData(string stringResult)
|
||||
protected virtual NetboxData? DeserializeJsonData(Stream stringResult)
|
||||
{
|
||||
return JsonSerializer.Deserialize<NetboxData>(stringResult, new JsonSerializerOptions
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue