Fixes: #U4-1992 - Creates DictionaryCacheRefresher to ensure that all cache associated with the dictionary is updated amongst all

servers when it is changed/removed. Removes RemoveByJson as we only actually require RefreshByJson since we can put any sort of parameters
in a custom json string including whether it is a remove operation (if required)
This commit is contained in:
Shannon Deminick
2013-03-23 01:59:25 +06:00
parent af2693af76
commit e97a01c75c
22 changed files with 219 additions and 247 deletions

View File

@@ -91,15 +91,6 @@ namespace Umbraco.Core.Sync
instances);
}
public void PerformRemove(IEnumerable<IServerAddress> servers, ICacheRefresher refresher, string jsonPayload)
{
if (servers == null) throw new ArgumentNullException("servers");
if (refresher == null) throw new ArgumentNullException("refresher");
if (jsonPayload == null) throw new ArgumentNullException("jsonPayload");
MessageSeversForIdsOrJson(servers, refresher, MessageType.RemoveByJson, jsonPayload: jsonPayload);
}
public void PerformRemove<T>(IEnumerable<IServerAddress> servers, ICacheRefresher refresher, Func<T, int> getNumericId, params T[] instances)
{
if (servers == null) throw new ArgumentNullException("servers");
@@ -283,15 +274,7 @@ namespace Umbraco.Core.Sync
}
//if we are not, then just invoke the call on the cache refresher
switch (dispatchType)
{
case MessageType.RefreshByJson:
jsonRefresher.Refresh(jsonPayload);
break;
case MessageType.RemoveByJson:
jsonRefresher.Remove(jsonPayload);
break;
}
jsonRefresher.Refresh(jsonPayload);
}
}
}
@@ -380,12 +363,7 @@ namespace Umbraco.Core.Sync
asyncResultsList.Add(
cacheRefresher.BeginRefreshByJson(
refresher.UniqueIdentifier, jsonPayload, _login, _password, null, null));
break;
case MessageType.RemoveByJson:
asyncResultsList.Add(
cacheRefresher.BeginRemoveByJson(
refresher.UniqueIdentifier, jsonPayload, _login, _password, null, null));
break;
break;
case MessageType.RefreshAll:
asyncResultsList.Add(
cacheRefresher.BeginRefreshAll(
@@ -438,9 +416,6 @@ namespace Umbraco.Core.Sync
case MessageType.RefreshByJson:
cacheRefresher.EndRefreshByJson(t);
break;
case MessageType.RemoveByJson:
cacheRefresher.EndRemoveByJson(t);
break;
case MessageType.RefreshAll:
cacheRefresher.EndRefreshAll(t);
break;