mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Minor polishing.
This commit is contained in:
@@ -38,8 +38,9 @@ namespace Orchard.Data.Migration {
|
|||||||
public ILogger Logger { get; set; }
|
public ILogger Logger { get; set; }
|
||||||
|
|
||||||
public void Activated() {
|
public void Activated() {
|
||||||
|
EnsureDistributedLockSchemaExists();
|
||||||
|
|
||||||
IDistributedLock @lock;
|
IDistributedLock @lock;
|
||||||
EnsureDistributedLockSchema();
|
|
||||||
if(_distributedLockService.TryAcquireLock(GetType().FullName, TimeSpan.FromMinutes(30), TimeSpan.FromMilliseconds(250), out @lock)) {
|
if(_distributedLockService.TryAcquireLock(GetType().FullName, TimeSpan.FromMinutes(30), TimeSpan.FromMilliseconds(250), out @lock)) {
|
||||||
using (@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.
|
// 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>
|
/// <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.
|
/// 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>
|
/// </summary>
|
||||||
private void EnsureDistributedLockSchema() {
|
private void EnsureDistributedLockSchemaExists() {
|
||||||
// Ensure the distributed lock record schema exists.
|
// Ensure the distributed lock record schema exists.
|
||||||
var schemaBuilder = new SchemaBuilder(_dataMigrationInterpreter);
|
var schemaBuilder = new SchemaBuilder(_dataMigrationInterpreter);
|
||||||
var distributedLockSchemaBuilder = new DistributedLockSchemaBuilder(_shellSettings, schemaBuilder);
|
var distributedLockSchemaBuilder = new DistributedLockSchemaBuilder(_shellSettings, schemaBuilder);
|
||||||
|
Reference in New Issue
Block a user