Skip to content

Commit

Permalink
Merge pull request #138 from mcrossley/master
Browse files Browse the repository at this point in the history
Fix start-up ping
  • Loading branch information
mcrossley authored Mar 10, 2022
2 parents e36c208 + 6f7e802 commit ec3138e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
11 changes: 4 additions & 7 deletions CumulusMX/Cumulus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
using System.Net.NetworkInformation;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Security.Authentication;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -27,7 +26,6 @@
using SQLite;
using Renci.SshNet;
using System.Collections.Concurrent;
using FluentFTP.Helpers;

namespace CumulusMX
{
Expand Down Expand Up @@ -1153,22 +1151,21 @@ public Cumulus(int HTTPport, bool DebugEnabled, string startParms)
do
{
Thread.Sleep(500);
} while (pingReply != null && DateTime.Now < pingTimeout);
} while (pingReply == null || DateTime.Now > pingTimeout);

if (DateTime.Now >= pingTimeout)
{
LogMessage("Ping Error: The PING failed to return after the timeout, cancelling it...");
ping.SendAsyncCancel();
}

}
catch (Exception e)
{
LogErrorMessage($"PING to {ProgramOptions.StartupPingHost} failed with error: {e.InnerException.Message}");
}
}

if (pingReply == null || pingReply.Status != IPStatus.Success)
if (pingReply?.Status != IPStatus.Success)
{
// no response wait 10 seconds before trying again
Thread.Sleep(10000);
Expand All @@ -1186,9 +1183,9 @@ public Cumulus(int HTTPport, bool DebugEnabled, string startParms)
}
}
}
} while ((pingReply == null || pingReply.Status != IPStatus.Success) && DateTime.Now < endTime);
} while (pingReply?.Status != IPStatus.Success && DateTime.Now < endTime);

if (DateTime.Now >= endTime)
if (DateTime.Now >= endTime)
{
LogConsoleMessage(msg3, ConsoleColor.Yellow);
LogMessage(msg3);
Expand Down
6 changes: 3 additions & 3 deletions CumulusMX/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Cumulus MX")]
[assembly: AssemblyDescription("Version 3.15.1 - Build 3170")]
[assembly: AssemblyDescription("Version 3.15.2 - Build 3171")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Cumulus MX")]
Expand All @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.15.1.3170")]
[assembly: AssemblyFileVersion("3.15.1.3170")]
[assembly: AssemblyVersion("3.15.2.3171")]
[assembly: AssemblyFileVersion("3.15.2.3171")]

0 comments on commit ec3138e

Please sign in to comment.