Skip to content

Commit 60a807c

Browse files
committed
Log errors per host
1 parent 9adaf56 commit 60a807c

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

AutoSSHApp.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,14 @@ public static void Main(string[] args)
465465
updateTimer.Change(1, 100);
466466
Parallel.ForEach(commands, (kv) =>
467467
{
468-
ClientLoop(backupFolder, kv.Key, kv.Value);
468+
try
469+
{
470+
ClientLoop(backupFolder, kv.Key, kv.Value);
471+
}
472+
catch (Exception ex)
473+
{
474+
Console.WriteLine("Error on host {0}: {1}", kv.Key.Host, ex);
475+
}
469476
});
470477
Console.WriteLine("Bytes downloaded: {0}, skipped: {1} ", BytesToString(bytesDownloaded), BytesToString(bytesSkipped));
471478
Console.WriteLine("Process completed at {0}, total time: {1:0.00} minutes.", DateTime.Now, stopWatch.Elapsed.TotalMinutes);
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
https://go.microsoft.com/fwlink/?LinkID=208121.
4+
-->
5+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
6+
<PropertyGroup>
7+
<Configuration>Release</Configuration>
8+
<Platform>Any CPU</Platform>
9+
<PublishDir>bin\Release\netcoreapp3.1\publish\</PublishDir>
10+
<PublishProtocol>FileSystem</PublishProtocol>
11+
<TargetFramework>netcoreapp3.1</TargetFramework>
12+
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
13+
<SelfContained>true</SelfContained>
14+
<PublishSingleFile>False</PublishSingleFile>
15+
<PublishReadyToRun>False</PublishReadyToRun>
16+
<PublishTrimmed>False</PublishTrimmed>
17+
</PropertyGroup>
18+
</Project>

0 commit comments

Comments
 (0)