Created strongly typed ICacheRefresher<T> so that now we can have cache refreshers execute against a
real instance object like IContent, this will dramatically increase performance for bulk publishing when not in a load balanced environment. Updated methods on DistributedCache to refresh many instances at one time, this also means we're not re-looking it back up again. Need to update media, users, templates, members and macros to use this new feature too.
This commit is contained in:
@@ -45,6 +45,19 @@ namespace Umbraco.Tests.Sync
|
||||
Assert.AreEqual(10, ((TestServerMessenger)ServerMessengerResolver.Current.Messenger).IntIdsRefreshed.Count);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RefreshIntIdFromObject()
|
||||
{
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
DistributedCache.Instance.Refresh(
|
||||
Guid.Parse("E0F452CB-DCB2-4E84-B5A5-4F01744C5C73"),
|
||||
x => x.Id,
|
||||
new TestObjectWithId{Id = i});
|
||||
}
|
||||
Assert.AreEqual(10, ((TestServerMessenger)ServerMessengerResolver.Current.Messenger).IntIdsRefreshed.Count);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RefreshGuidId()
|
||||
{
|
||||
@@ -77,6 +90,11 @@ namespace Umbraco.Tests.Sync
|
||||
|
||||
#region internal test classes
|
||||
|
||||
internal class TestObjectWithId
|
||||
{
|
||||
public int Id { get; set; }
|
||||
}
|
||||
|
||||
internal class TestCacheRefresher : ICacheRefresher
|
||||
{
|
||||
public Guid UniqueIdentifier
|
||||
|
||||
Reference in New Issue
Block a user