public IActionResult UpdateEngineConnectionStatus([FromBody] ConnectionInformation connectionInformation) { if (connectionInformation.Status == ConnectionStatus.Disconnected) { Logger.LogError( "Connections", $"Engine informed of Disconnect. Reason: {connectionInformation.Reason}.\n Disconnecting all clients and stopping"); cloudIntegrationService.Announce(CloudCallbackType.Failed); hubContext.Clients.All.SendAsync("Disconnect", new Guid()); runnerStateService.StopApplication(); } return(Ok()); }
private void BotConnectionTimeout(object sender, ElapsedEventArgs e) { if (runnerStateService.TotalConnections < runnerConfig.BotCount) { var failReason = $"{runnerStateService.TotalConnections} out of {runnerConfig.BotCount} bots connected in time, runner is shutting down."; Logger.LogDebug( "RunnerHub.OnBotConnectionTimeout", failReason); runnerStateService.FailureReason = failReason; cloudIntegrationService.Announce(CloudCallbackType.Failed) .GetAwaiter() .OnCompleted(() => runnerStateService.StopApplication()); } }
private void BotConnectionTimeout(object sender, ElapsedEventArgs e) { if (runnerStateService.TotalConnections < runnerConfig.BotCount) { Logger.LogDebug( "RunnerHub.OnBotConnectionTimeout", string.Format( "{0} out of {1} bots connected in time, runner is shutting down.", runnerStateService.TotalConnections, runnerConfig.BotCount)); cloudIntegrationService.Announce(CloudCallbackType.Failed) .GetAwaiter() .OnCompleted(() => runnerStateService.StopApplication()); } }