aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2020-06-17 14:44:21 +0300
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2020-06-17 14:44:21 +0300
commit9d1a217a8410e36cb224e7d47f49326c0e92c474 (patch)
tree94469fa5f08c47ffe5a1a3756b6d66ff80dd3b9f /Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs
parent487fc03281c2dfde034e73ad99bd74ec4f63f69a (diff)
parent920fe3a098f304b6c65e1c37447138f0699ec70c (diff)
downloadTango-9d1a217a8410e36cb224e7d47f49326c0e92c474.tar.gz
Tango-9d1a217a8410e36cb224e7d47f49326c0e92c474.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs
index 29bffb945..c73cc6196 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs
@@ -106,6 +106,7 @@ namespace Tango.PPC.Common.MachineUpdate
_client = ppcWebClient;
_machineProvider = machineProvider;
_app_manager = applicationManager;
+ _app_manager.ApplicationReady += _app_manager_ApplicationReady;
_packageRunner = packageRunner;
_packageRunner.PackageProgress += _packageRunner_PackageProgress;
@@ -116,7 +117,7 @@ namespace Tango.PPC.Common.MachineUpdate
_checkForUpdateTimer = new System.Timers.Timer(_settings.AutoUpdateCheckInterval.TotalMilliseconds);
_checkForUpdateTimer.Elapsed += _checkForUpdateTimer_Elapsed;
- _checkForUpdateTimer.Start();
+ _checkForUpdateTimer.Stop();
externalBridge.RegisterRequestHandler(this);
}
@@ -125,6 +126,11 @@ namespace Tango.PPC.Common.MachineUpdate
#region Event Handlers
+ private void _app_manager_ApplicationReady(object sender, EventArgs e)
+ {
+ _checkForUpdateTimer.Start();
+ }
+
private void _packageRunner_PackageProgress(object sender, PackageProgressEventArgs e)
{
UpdateProgress(e.PackageName, e.Message, e.IsIntermediate, e.Progress, e.Total);
@@ -1679,7 +1685,6 @@ namespace Tango.PPC.Common.MachineUpdate
var response = await CheckForUpdate(_machineProvider.Machine.SerialNumber);
if (response.IsUpdateAvailable || response.IsDatabaseUpdateAvailable)
{
- _checkForUpdateTimer.Interval = TimeSpan.FromMinutes(60).TotalMilliseconds;
LogManager.Log($"New {(response.IsDatabaseUpdateAvailable ? "database updates" : "application version")} detected ({response.Version}). Raising event...");
UpdateAvailable?.Invoke(this, response);
}