/// <summary> /// Creates notification if database deployment failed. /// Notification severity is determined by whether the application is stuck in prerequisites mode. /// </summary> /// <returns>Notification</returns> public async Task <PDBNotification> GetDatabaseDeploymentFailureAlertAsync() { // TODO make sure that async results don't deadlock web server or add non-async repo methods var databaseDeplymentService = new DatabaseDeploymentService(this.eventRepository, this.serverRepository); var eventSystemState = await this.eventRepository.ReadEventSystemStateAsync(); return((await databaseDeplymentService.FindAnyFailedDeployments()) ? new PDBNotification() { Type = eventSystemState == EventSystemState.Prerequisites ? NotificationType.Critical : NotificationType.Warning, Message = Messages.Notification.DeploymentFailure } : null); }
internal static void DeployDatabase(IHelper helper) { var service = new DatabaseDeploymentService(helper); service.DeployDatabase(); }