aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Web/Tango.MachineService/Controllers
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2020-03-18 10:03:11 +0200
committerShlomo Hecht <shlomo@twine-s.com>2020-03-18 10:03:11 +0200
commitada2ce25bd36b6f7b3c8aa01039cc9611b22e55c (patch)
tree0684b4e94a807188d2d92f46c33ed36b724692bc /Software/Visual_Studio/Web/Tango.MachineService/Controllers
parent2cd94c78ab9de58fc1f8525e69ab5fa563d0ff75 (diff)
parentcb7fff096f2fe6812184a286290eaad193c7c2df (diff)
downloadTango-ada2ce25bd36b6f7b3c8aa01039cc9611b22e55c.tar.gz
Tango-ada2ce25bd36b6f7b3c8aa01039cc9611b22e55c.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;