public override void Run() { var success = false; var fileLock = FileLockFactory.GetFileLock(this.LockFile); if (Timeout.HasValue) { success = fileLock.Lock(this.Timeout.Value); } else { success = fileLock.Lock(); } if (!success) { throw new JobExecutionException("Failed to acquire file-lock within the specified timeout"); } }
public override void Run() => FileLockFactory.GetFileLock(LockFile).Unlock();