Browse Source

add to dirty data if db was written

arthur.wu 2 years ago
parent
commit
5b80b4866a
2 changed files with 3 additions and 2 deletions
  1. 2 1
      Interfaces/Cache/CacheManager.cs
  2. 1 1
      Interfaces/OpLog/DatabaseCollection.cs

+ 2 - 1
Interfaces/Cache/CacheManager.cs

@@ -21,7 +21,7 @@ namespace WingServerCommon.Interfaces.Cache
         /// </summary>
         /// <typeparam name="string"></typeparam>
         /// <returns></returns>
-        private readonly  IList<string> _dirtyCodes = new List<string>();
+        private readonly List<string> _dirtyCodes = new List<string>();
 
         /// <summary>
         /// Load cache from db objects
@@ -65,6 +65,7 @@ namespace WingServerCommon.Interfaces.Cache
         {
             var ids = args.DocumentIds;
             CacheList.RemoveMany(ids);
+            _dirtyCodes.AddRange(ids);
         }
 
         /// <summary>

+ 1 - 1
Interfaces/OpLog/DatabaseCollection.cs

@@ -4,7 +4,7 @@ namespace WingServerCommon.Interfaces.OpLog
     public class DatabaseCollection
     {
         /// <summary>
-        /// Database Collection Changed (just for update or delete)
+        /// Database Collection Changed (for db write operation)
         /// </summary>
         public static event EventHandler<CollectionDocumentChangedArgs> CollectionDocumentChanged;