@@ -189,18 +189,20 @@ private async Task OnRestart() {
189
189
/// Restarts the docker images.
190
190
/// </summary>
191
191
private async Task OnRestartImages ( ) {
192
- using SshClient client = new ( _serverAddress ! , _sshUsername ! , _sshPassword ! ) ;
193
- await client . ConnectAsync ( CancellationToken . None ) ;
194
- string [ ] command = [
195
- "docker compose -p nullinside-ui restart" ,
196
- "docker compose -p nullinside-api restart" ,
197
- "docker compose -p nullinside-api-null restart" ,
198
- "docker compose -p nullinside-api-twitch-bot restart"
199
- ] ;
200
-
201
- foreach ( string line in command ) {
202
- using SshCommand ? ssh = client . RunCommand ( $ "echo { _sshPassword } | sudo -S { line } ") ;
203
- }
192
+ await Task . Run ( async ( ) => {
193
+ using SshClient client = new ( _serverAddress ! , _sshUsername ! , _sshPassword ! ) ;
194
+ await client . ConnectAsync ( CancellationToken . None ) ;
195
+ string [ ] command = [
196
+ "docker compose -p nullinside-ui restart" ,
197
+ "docker compose -p nullinside-api restart" ,
198
+ "docker compose -p nullinside-api-null restart" ,
199
+ "docker compose -p nullinside-api-twitch-bot restart"
200
+ ] ;
201
+
202
+ foreach ( string line in command ) {
203
+ using SshCommand ? ssh = client . RunCommand ( $ "echo { _sshPassword } | sudo -S { line } ") ;
204
+ }
205
+ } ) ;
204
206
}
205
207
206
208
/// <summary>
0 commit comments