Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
bassmaster187 committed Dec 7, 2024
1 parent ea041db commit a6889ef
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions TeslaLogger/TelemetryConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ public bool Driving
if (driving)
{
var ts = DateTime.Now - lastDriving;
if (ts.TotalMinutes > 10)
if (ts.TotalMinutes > 30)
{
Log("Stop Driving by timeout 30 minutes ***");
driving = false;
Log("Parking time: " + lastDriving.ToString());
return false;
Expand Down Expand Up @@ -206,9 +207,18 @@ private void Run()
else if (ex.InnerException?.InnerException is System.Net.Sockets.SocketException se)
{
Log(se.Message);
car.CreateExceptionlessClient(ex.InnerException).Submit();
}
else if (ex.InnerException?.InnerException != null)
{
Log(ex.InnerException.Message);
car.CreateExceptionlessClient(ex.InnerException).Submit();
}
else
Log("Telemetry Exception: " + ex.ToString());
{
Log("Telemetry Exception: " + ex.ToString());
car.CreateExceptionlessClient(ex).Submit();
}

var s = r.Next(30000, 60000);
Thread.Sleep(s);
Expand Down Expand Up @@ -1312,7 +1322,11 @@ private void ConnectToServer()
if (ex is AggregateException ex2)
{
Log("Connect to Telemetry Server Error: " + ex2.InnerException.Message);
car.CreateExceptionlessClient(ex2).Submit();
if (ex.InnerException != null)
car.CreateExceptionlessClient(ex2.InnerException).Submit();
else
car.CreateExceptionlessClient(ex2).Submit();

Thread.Sleep(60000);
}
else
Expand Down

0 comments on commit a6889ef

Please sign in to comment.