diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-12-03 03:48:25 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-12-03 03:48:25 +0200 |
| commit | 3f2397750a3f5bbdf5ef78049c237ebeaff78319 (patch) | |
| tree | 3a8b325c1f04fa90c114893d84c65020fce7920d /Software/Visual_Studio/PPC/Tango.PPC.Common/DataStore | |
| parent | c873eb1c0324eb50428fc26cdb5f1c3d05c7d3ea (diff) | |
| download | Tango-3f2397750a3f5bbdf5ef78049c237ebeaff78319.tar.gz Tango-3f2397750a3f5bbdf5ef78049c237ebeaff78319.zip | |
DataStore fixes.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/DataStore')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.Common/DataStore/DefaultDataStoreService.cs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/DataStore/DefaultDataStoreService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/DataStore/DefaultDataStoreService.cs index 4d2e9c1df..02539aed9 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/DataStore/DefaultDataStoreService.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/DataStore/DefaultDataStoreService.cs @@ -189,6 +189,8 @@ namespace Tango.PPC.Common.DataStore { var allItems = db.DataStoreItems.ToList(); + List<BL.Entities.DataStoreItem> deleted = new List<BL.Entities.DataStoreItem>(); + foreach (var guid in request.ToDelete) { var item = allItems.FirstOrDefault(x => x.Guid == guid); @@ -197,6 +199,7 @@ namespace Tango.PPC.Common.DataStore item.IsDeleted = true; item.IsSynchronized = true; item.LastUpdated = DateTime.UtcNow; + deleted.Add(item); } } @@ -246,6 +249,22 @@ namespace Tango.PPC.Common.DataStore Logging.LogManager.Default.Log(ex, $"Error notifying firmware about data store item change '{item.CollectionName}.{item.Key}'."); } } + + foreach (var item in deleted) + { + try + { + var response = _machineProvider.MachineOperator.SendRequest<DataStoreItemModifiedRequest, DataStoreItemModifiedResponse>(new DataStoreItemModifiedRequest() + { + Collection = item.CollectionName, + Key = item.Key + }).Result; + } + catch (Exception ex) + { + Logging.LogManager.Default.Log(ex, $"Error notifying firmware about data store item change '{item.CollectionName}.{item.Key}'."); + } + } }); } } |
