@@ -29,7 +29,7 @@ public Updater(string gitHubRepository)
29
29
GitHubRepository = gitHubRepository ;
30
30
}
31
31
32
- public async Task UpdateApp ( IPublicAPI api , bool silentUpdate = true )
32
+ public async Task UpdateApp ( IPublicAPI api , bool silentUpdate = true )
33
33
{
34
34
UpdateManager updateManager ;
35
35
UpdateInfo newUpdateInfo ;
@@ -39,7 +39,7 @@ public async Task UpdateApp(IPublicAPI api , bool silentUpdate = true)
39
39
40
40
try
41
41
{
42
- updateManager = await GitHubUpdateManager ( GitHubRepository ) ;
42
+ updateManager = await GitHubUpdateManager ( GitHubRepository ) . ConfigureAwait ( false ) ;
43
43
}
44
44
catch ( Exception e ) when ( e is HttpRequestException || e is WebException || e is SocketException )
45
45
{
@@ -50,7 +50,7 @@ public async Task UpdateApp(IPublicAPI api , bool silentUpdate = true)
50
50
try
51
51
{
52
52
// UpdateApp CheckForUpdate will return value only if the app is squirrel installed
53
- newUpdateInfo = await updateManager . CheckForUpdate ( ) . NonNull ( ) ;
53
+ newUpdateInfo = await updateManager . CheckForUpdate ( ) . NonNull ( ) . ConfigureAwait ( false ) ;
54
54
}
55
55
catch ( Exception e ) when ( e is HttpRequestException || e is WebException || e is SocketException )
56
56
{
@@ -85,8 +85,8 @@ public async Task UpdateApp(IPublicAPI api , bool silentUpdate = true)
85
85
updateManager . Dispose ( ) ;
86
86
return ;
87
87
}
88
-
89
- await updateManager . ApplyReleases ( newUpdateInfo ) ;
88
+
89
+ await updateManager . ApplyReleases ( newUpdateInfo ) . ConfigureAwait ( false ) ;
90
90
91
91
if ( DataLocation . PortableDataLocationInUse ( ) )
92
92
{
@@ -98,11 +98,11 @@ public async Task UpdateApp(IPublicAPI api , bool silentUpdate = true)
98
98
}
99
99
else
100
100
{
101
- await updateManager . CreateUninstallerRegistryEntry ( ) ;
101
+ await updateManager . CreateUninstallerRegistryEntry ( ) . ConfigureAwait ( false ) ;
102
102
}
103
103
104
104
var newVersionTips = NewVersinoTips ( newReleaseVersion . ToString ( ) ) ;
105
-
105
+
106
106
Log . Info ( $ "|Updater.UpdateApp|Update success:{ newVersionTips } ") ;
107
107
108
108
// always dispose UpdateManager
@@ -133,9 +133,9 @@ private async Task<UpdateManager> GitHubUpdateManager(string repository)
133
133
var uri = new Uri ( repository ) ;
134
134
var api = $ "https://api.github.com/repos{ uri . AbsolutePath } /releases";
135
135
136
- var json = await Http . GetAsync ( api ) ;
136
+ var jsonStream = await Http . GetStreamAsync ( api ) . ConfigureAwait ( false ) ;
137
137
138
- var releases = JsonConvert . DeserializeObject < List < GithubRelease > > ( json ) ;
138
+ var releases = await System . Text . Json . JsonSerializer . DeserializeAsync < List < GithubRelease > > ( jsonStream ) . ConfigureAwait ( false ) ;
139
139
var latest = releases . Where ( r => ! r . Prerelease ) . OrderByDescending ( r => r . PublishedAt ) . First ( ) ;
140
140
var latestUrl = latest . HtmlUrl . Replace ( "/tag/" , "/download/" ) ;
141
141
0 commit comments