Merge MKDT_0007

This commit is contained in:
2025-04-28 12:51:07 -04:00
parent dd988c286f
commit aab934a0e0
2 changed files with 7 additions and 17 deletions

View File

@@ -27,6 +27,7 @@ namespace IPMonitor
/// <param name="configuration"></param>
public void RunService(String[] args,IConfiguration configuration)
{
Profiler profiler=new Profiler();
DateTime currentDate = DateTime.Now;
GlobalConfig.Instance.Configuration = configuration; // This call sets up configuration stuff so it needs to be first.
@@ -41,8 +42,6 @@ namespace IPMonitor
try
{
Profiler profiler=new Profiler();
profiler.Start();
MDTrace.WriteLine(LogLevel.DEBUG,$"[RunService] Started @ {Utility.DateTimeToStringYYYYHMMHDDHHMMSSTT(currentDate)} in {Directory.GetCurrentDirectory()}");
MDTrace.WriteLine(LogLevel.DEBUG,$"[RunService] Argument {arg}");
@@ -59,6 +58,10 @@ namespace IPMonitor
{
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Exception:{0}",exception.ToString()));
}
finally
{
MDTrace.WriteLine(LogLevel.DEBUG,$"Done, total took {profiler.End()} (ms)");
}
}
private static bool CreateLogging(String task)
@@ -147,7 +150,7 @@ namespace IPMonitor
for(int index=0;index<MAX_RETRIES && null==address;index++)
{
MDTrace.WriteLine(LogLevel.DEBUG,$"Requesting IPAddress from {request}");
if(!NetworkStatus.IsNetworkAvailable(0))
if(!NetworkStatus.IsNetworkAvailable())
{
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("The Network seems to be disconnected. Will retry after {0} (ms) ",request,TIMEOUT_BETWEEN_ATTEMPTS));
try{Thread.Sleep(TIMEOUT_BETWEEN_ATTEMPTS);}catch{;}