aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Web/Tango.MachineService/Controllers
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2020-03-01 17:47:27 +0200
committerAvi Levkovich <avi@twine-s.com>2020-03-01 17:47:27 +0200
commit6c1f8f8df6b9ee71104098f548ba8be8504fc89b (patch)
treefc0948888bb5dc156341f73d82306b26cc8523df /Software/Visual_Studio/Web/Tango.MachineService/Controllers
parent046fce068413ae04454d07a0fd591bb200b30eef (diff)
parent2c0f48e170634b93daa75abda4e246e85ffed519 (diff)
downloadTango-6c1f8f8df6b9ee71104098f548ba8be8504fc89b.tar.gz
Tango-6c1f8f8df6b9ee71104098f548ba8be8504fc89b.zip
merge conflicts
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;