Exemplo n.º 1
0
        void Do(LoadCurrentHeadDeploymentCommand command, CancellationToken cancellationToken)
        {
            if (cancellationToken.IsCancellationRequested)
            {
                return;
            }

            string newEtag;
            var    newDeployment = _hostContext.DeploymentReader.GetDeploymentIfModified(_currentDeploymentEtag, out newEtag);

            if (newDeployment == null || newEtag == _currentDeploymentEtag)
            {
                return;
            }

            var newSolution = _hostContext.DeploymentReader.GetSolution(newDeployment);

            if (newSolution == null)
            {
                return;
            }

            if (_currentSolution == null || !_currentSolution.Equals(newSolution))
            {
                _currentDeploymentEtag = null;
                OnDeploymentChanged(newDeployment, newSolution, cancellationToken);
                _currentDeploymentEtag = newEtag;
            }
        }
Exemplo n.º 2
0
        void Do(LoadCurrentHeadDeploymentCommand command, CancellationToken cancellationToken)
        {
            if (cancellationToken.IsCancellationRequested)
            {
                return;
            }

            string newEtag;
            var newDeployment = _hostContext.DeploymentReader.GetDeploymentIfModified(_currentDeploymentEtag, out newEtag);
            if (newDeployment == null || newEtag == _currentDeploymentEtag)
            {
                return;
            }

            var newSolution = _hostContext.DeploymentReader.GetSolution(newDeployment);
            if (newSolution == null)
            {
                return;
            }

            if (_currentSolution == null || !_currentSolution.Equals(newSolution))
            {
                _currentDeploymentEtag = null;
                OnDeploymentChanged(newDeployment, newSolution, cancellationToken);
                _currentDeploymentEtag = newEtag;
            }
        }