SenseNet.Messaging.NotificationHandler.AcquireLock C# (CSharp) Method

AcquireLock() static private method

static private AcquireLock ( double timeframe ) : bool
timeframe double
return bool
        internal static bool AcquireLock(double timeframe)
        {
            Synchronization notificationLock;
            
            using (var context = new DataHandler())
            {
                notificationLock = context.Synchronizations.SingleOrDefault(lockItem => lockItem.LockName == NOTIFICATIONLOCKNAME);
                if (notificationLock == null)
                    return InsertLock(timeframe);
            }
            
            if (notificationLock.Locked && (notificationLock.LockId != AppDomainId) && notificationLock.LockedUntil > DateTime.Now)
                return false;

            return UpdateLock(notificationLock, timeframe);
        }
        internal static void RefreshLock(double timeframe)