Minor polishing.

This commit is contained in:
Sipke Schoorstra
2015-09-04 14:43:30 +01:00
parent 3efc38dc65
commit 94db186b37

View File

@@ -38,8 +38,9 @@ namespace Orchard.Data.Migration {
public ILogger Logger { get; set; }
public void Activated() {
EnsureDistributedLockSchemaExists();
IDistributedLock @lock;
EnsureDistributedLockSchema();
if(_distributedLockService.TryAcquireLock(GetType().FullName, TimeSpan.FromMinutes(30), TimeSpan.FromMilliseconds(250), out @lock)) {
using (@lock) {
// Let's make sure that the basic set of features is enabled. If there are any that are not enabled, then let's enable them first.
@@ -72,7 +73,7 @@ namespace Orchard.Data.Migration {
/// <summary>
/// This ensures that the framework migrations have run for the distributed locking feature, as existing Orchard installations will not have the required tables when upgrading.
/// </summary>
private void EnsureDistributedLockSchema() {
private void EnsureDistributedLockSchemaExists() {
// Ensure the distributed lock record schema exists.
var schemaBuilder = new SchemaBuilder(_dataMigrationInterpreter);
var distributedLockSchemaBuilder = new DistributedLockSchemaBuilder(_shellSettings, schemaBuilder);