Ejemplo n.º 1
0
        public override void Release(JobLock jobLock)
        {
            if (!jobLock.LockAcquired)
            {
                if (Settings.Current.LogJobLocks)
                {
                    string processName = "{Unknown}";
                    int    processId   = 0;
                    try {
                        Process p = Process.GetCurrentProcess();
                        processId   = p.Id;
                        processName = p.ProcessName;
                    } catch {}
                    Log.Debug().Message("Tried to release job lock '{0}' that wasn't acquired on {1}; process {2}:{3}",
                                        jobLock.LockName, Environment.MachineName, processName, processId).Write();
                }

                return;
            }

            try {
                _cacheClient.Remove("joblock:" + jobLock.LockName);
            } catch (Exception e) {
                Log.Error().Message("Error attempting to release job lock '{0}' on {1}.", jobLock.LockName, Environment.MachineName).Exception(e).Report().Write();
            }

            if (Settings.Current.LogJobLocks)
            {
                string processName = "{Unknown}";
                int    processId   = 0;
                try {
                    Process p = Process.GetCurrentProcess();
                    processId   = p.Id;
                    processName = p.ProcessName;
                } catch {}
                Log.Debug().Message("Released job lock '{0}' on {1}; process {2}:{3}",
                                    jobLock.LockName, Environment.MachineName, processName, processId).Write();
            }

            jobLock.SetReleased();
        }
 /// <summary>
 /// Releases the specified job lock.
 /// </summary>
 /// <param name="jobLock">The job lock.</param>
 public override void Release(JobLock jobLock)
 {
     //Do nothing for default
     jobLock.SetReleased();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Releases the specified job lock.
 /// </summary>
 /// <param name="jobLock">The job lock.</param>
 public override void Release(JobLock jobLock)
 {
     jobLock.SetReleased();
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Releases the specified job lock.
 /// </summary>
 /// <param name="jobLock">The job lock.</param>
 public override void Release(JobLock jobLock)
 {
     //Do nothing for default
     jobLock.SetReleased();
 }