Narrowed the lock scope to per-thread.

This commit is contained in:
Sipke Schoorstra
2015-08-22 17:11:03 +01:00
parent 1cf2b6cf27
commit 079fb1f84b

View File

@@ -30,7 +30,7 @@ namespace Orchard.Data.Migration {
public void Activated() {
DistributedLock @lock;
if(_distributedLockService.TryAcquireLockForMachine(GetType().FullName, TimeSpan.FromMinutes(30), TimeSpan.FromMilliseconds(250), out @lock)) {
if(_distributedLockService.TryAcquireLockForThread(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.
var theseFeaturesShouldAlwaysBeActive = new[] {