private async void UpdateDeploySystemStatus(object state)
        {
            try
            {
                log.Info("Deploy system state polling started.");
                var started = DateTime.Now;
                var status  = await deployStatusInfoClient.GetDeployStatus();

                log.InfoFormat("Deploy system state polling finished in {0}ms.", (DateTime.Now - started).TotalMilliseconds);

                log.Info("Pushing out update via SignalR.");
                var newEnvironments       = GetEnvironments(status, deployStatusInfoClient.DeployUserResolver);
                var newDeploySystemStatus = new DeploySystemStatus(deployStatusConfiguration.Name, DateTime.UtcNow, newEnvironments);

                Interlocked.Exchange(ref deploySystemStatus, newDeploySystemStatus);

                context.Clients.All.DeploySystemStatusChanged(newDeploySystemStatus);
                log.Info("SignalR update pushed.");
            }
            catch (Exception ex)
            {
                log.Error($"Error occurred polling for deploy status: {ex}.", ex);
                Debug.Assert(true, ex.ToString());
            }

            timer.Change(TimeSpan.FromSeconds(15), TimeSpan.FromMilliseconds(-1));
        }
示例#2
0
        private async void UpdateDeploySystemStatus(object state)
        {
            try
            {
                log.Info("Deploy system state polling started.");
                var started = DateTime.Now;
                var status = await deployStatusInfoClient.GetDeployStatus();
                log.InfoFormat("Deploy system state polling finished in {0}ms.", (DateTime.Now - started).TotalMilliseconds);

                log.Info("Pushing out update via SignalR.");
                var newEnvironments = GetEnvironments(status, deployStatusInfoClient.DeployUserResolver);
                var newDeploySystemStatus = new DeploySystemStatus(deployStatusConfiguration.Name, DateTime.UtcNow, newEnvironments);

                Interlocked.Exchange(ref deploySystemStatus, newDeploySystemStatus);

                context.Clients.All.DeploySystemStatusChanged(newDeploySystemStatus);
                log.Info("SignalR update pushed.");
            }
            catch (Exception ex)
            {
                log.Error($"Error occurred polling for deploy status: {ex}.", ex);
                Debug.Assert(true, ex.ToString());
            }

            timer.Change(TimeSpan.FromSeconds(15), TimeSpan.FromMilliseconds(-1));
        }