mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-12-11 00:53:35 +00:00
Fix async context handling in blob config loading
Added ConfigureAwait(false) to async HTTP call and moved Compile() invocation to immediately after deserialization. This improves async context handling and ensures blob config is compiled before assignment.
This commit is contained in:
parent
6896c272ef
commit
d0c031fe32
|
|
@ -442,14 +442,14 @@ namespace WelsonJS.Launcher
|
|||
return;
|
||||
}
|
||||
|
||||
using (var response = await _httpClient.GetStreamAsync(url))
|
||||
using (var response = await _httpClient.GetStreamAsync(url).ConfigureAwait(false))
|
||||
using (var reader = new StreamReader(response))
|
||||
{
|
||||
var serializer = new XmlSerializer(typeof(BlobConfig));
|
||||
_blobConfig = (BlobConfig)serializer.Deserialize(reader);
|
||||
var cfg = (BlobConfig)serializer.Deserialize(reader);
|
||||
cfg?.Compile();
|
||||
_blobConfig = cfg;
|
||||
}
|
||||
|
||||
_blobConfig?.Compile();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user