aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common/DataStore
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-12-03 03:48:25 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-12-03 03:48:25 +0200
commit3f2397750a3f5bbdf5ef78049c237ebeaff78319 (patch)
tree3a8b325c1f04fa90c114893d84c65020fce7920d /Software/Visual_Studio/PPC/Tango.PPC.Common/DataStore
parentc873eb1c0324eb50428fc26cdb5f1c3d05c7d3ea (diff)
downloadTango-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.cs19
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}'.");
+ }
+ }
});
}
}