aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Web/Tango.MachineService/Controllers
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2020-02-25 11:35:18 +0200
committerShlomo Hecht <shlomo@twine-s.com>2020-02-25 11:35:18 +0200
commit5c8596be64deacfbe282c03ba21cec66ed4e2494 (patch)
treea8d3632748b8a56859936810e170883f92e4fbc0 /Software/Visual_Studio/Web/Tango.MachineService/Controllers
parentc3b9b401883c2ef45accfa2d26c7ff6276691c34 (diff)
parentfdb539e472eaaaff74a05aa661e471543ae07313 (diff)
downloadTango-5c8596be64deacfbe282c03ba21cec66ed4e2494.tar.gz
Tango-5c8596be64deacfbe282c03ba21cec66ed4e2494.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/Web/Tango.MachineService/Controllers')
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs22
1 files changed, 22 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs
index b132a4c48..71e540dbf 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs
+++ b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs
@@ -24,6 +24,7 @@ using Tango.Web.ActiveDirectory;
using Tango.Core.Cryptography;
using Tango.MachineService.Filters;
using Tango.BL.DTO;
+using Z.EntityFramework.Plus;
namespace Tango.MachineService.Controllers
{
@@ -170,6 +171,27 @@ namespace Tango.MachineService.Controllers
Token = response.NotifyCompletedToken,
TangoUpdateGuid = tangoUpdate.Guid,
});
+
+ Task.Factory.StartNew(() =>
+ {
+ using (ObservablesContext b = ObservablesContextHelper.CreateContext())
+ {
+ //Reset Job Runs.
+ try
+ {
+ b.JobRuns.Where(x => x.MachineGuid == machine.Guid && x.IsSynchronized).Update(x => new JobRun() { IsSynchronized = false });
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, $"Error resetting synchronized job runs for machine '{machine.SerialNumber}'.");
+ }
+
+ //Reset Events.
+ //b.MachinesEvents.Where(x => x.MachineGuid == machine.Guid).Update(x => new MachinesEvent() { IsSynchronized = false });
+ //Reset Jobs.
+ //b.Jobs.Where(x => x.MachineGuid == machine.Guid).Update(x => new Job() { IsSynchronized = false });
+ }
+ });
}
return response;