Merge pull request #6646 from jtkech/patch-3

[Fixes #6638] AliasHolderUpdater Refresh() is called 2 times
This commit is contained in:
Sébastien Ros 2016-03-24 14:46:17 -07:00
commit 5ecfcd861a
2 changed files with 1 additions and 39 deletions

View File

@ -1,37 +0,0 @@
using System;
using Orchard.Environment;
using Orchard.Tasks;
using Orchard.Logging;
namespace Orchard.Alias.Implementation.Updater {
public class AliasHolderUpdaterTask : IOrchardShellEvents, IBackgroundTask {
private readonly IAliasHolderUpdater _aliasHolderUpdater;
public ILogger Logger { get; set; }
public AliasHolderUpdaterTask(IAliasHolderUpdater aliasHolderUpdater) {
_aliasHolderUpdater = aliasHolderUpdater;
Logger = NullLogger.Instance;
}
void IOrchardShellEvents.Activated() {
Refresh();
}
void IOrchardShellEvents.Terminating() {
}
private void Refresh() {
try {
_aliasHolderUpdater.Refresh();
}
catch (Exception ex) {
Logger.Error(ex, "Exception during Alias refresh");
}
}
public void Sweep() {
Refresh();
}
}
}

View File

@ -135,7 +135,6 @@
<Compile Include="Implementation\Holder\IAliasHolder.cs" />
<Compile Include="Implementation\Map\AliasMap.cs" />
<Compile Include="Implementation\Storage\AliasStorage.cs" />
<Compile Include="Implementation\Updater\AliasHolderUpdaterTask.cs" />
<Compile Include="Implementation\Utils.cs" />
<Compile Include="Migrations.cs" />
<Compile Include="Recipes\Builders\AliasStep.cs" />
@ -195,4 +194,4 @@
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
</Project>
</Project>