Skip to content

Commit

Permalink
Sending of nearby SuC data should be configurable for the user (prefe…
Browse files Browse the repository at this point in the history
…rrably Opt-In) #1163
  • Loading branch information
bassmaster187 committed Jan 25, 2024
1 parent 7ea7888 commit 85afc3b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
4 changes: 3 additions & 1 deletion TeslaLogger/NearbySuCService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ public void Run()
{
while (true)
{
Work();
if (Tools.UseNearbySuCService())
Work();

// sleep 5 Minutes
Thread.Sleep(300000);
}
Expand Down
21 changes: 8 additions & 13 deletions TeslaLogger/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,21 +113,16 @@ private static void InitNearbySuCService()
{
try
{
if (Tools.UseNearbySuCService())

Thread threadNearbySuCService = new Thread(() =>
{
Thread threadNearbySuCService = new Thread(() =>
{
NearbySuCService.GetSingleton().Run();
})
{
Name = "NearbySuCServiceThread"
};
threadNearbySuCService.Start();
}
else
NearbySuCService.GetSingleton().Run();
})
{
Logfile.Log("NearbySuCService disabled (enable in settings)");
}
Name = "NearbySuCServiceThread"
};
threadNearbySuCService.Start();

}
catch (Exception ex)
{
Expand Down
3 changes: 1 addition & 2 deletions TeslaLogger/Tools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ public static class Tools

internal static bool UseNearbySuCService()
{
// TODO
return true;
return Tools.IsShareData();
}

private static string _OSVersion = string.Empty;
Expand Down

0 comments on commit 85afc3b

Please sign in to comment.