Пример #1
0
        public Task ReleaseLease(LeaseReleaseOptions options)
        {
            if (weAreTheLeader)
            {
                LeaderSwapOverIfRequired();
            }

            return(Task.FromResult(true));
        }
        public async Task ReleaseLease(LeaseReleaseOptions options)
        {
            try
            {
                await leaseBlob.ReleaseLeaseAsync(new AccessCondition { LeaseId = NodeToLeaseIdentifier(options.NodeId) });

                logger.Info("Lease released.");
            }
            catch (StorageException e)
            {
                // Lease will eventually be released.
                logger.ErrorFormat("Could not release the lease {0}", nameof(ReleaseLease), e.Message);
            }
        }
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Release. </summary>
        ///
        /// <param name="options">  Options for controlling the operation. </param>
        ///
        /// <returns>   The asynchronous result. </returns>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        public Task ReleaseLease(LeaseReleaseOptions options)
        {
            Console.WriteLine("Release Lease", Color.Yellow);
            _owningNodeId = string.Empty;
            return(Task.FromResult(true));
        }
 public Task ReleaseLease(LeaseReleaseOptions options)
 {
     WarnOfUse();
     owningNodeId = string.Empty;
     return(Task.FromResult(true));
 }
 public Task ReleaseLease(LeaseReleaseOptions options)
 {
     return(Task.FromResult(true));
 }