private async Task StartAppInitialization(InitCommandContext context) { foreach (var appInstallation in context.AppInstallations) { _log.InfoFormat(Resources.InitCommandHandler_StartInitialization, appInstallation); // Запуск рабочего процесса приложения await _appService.Init(appInstallation, context.CommandOptions.Timeout); } }
private Task FindAppInstallations(InitCommandContext context) { context.AppInstallations = _installDirectory.GetItems(context.CommandOptions.Id, context.CommandOptions.Version, context.CommandOptions.Instance); if ((context.AppInstallations == null) || (context.AppInstallations.Length <= 0)) { throw new CommandHandlerException(Resources.InitCommandHandler_CanNotFindAnyApplicationsToStart); } return(AsyncHelper.EmptyTask); }
public override async Task Handle(InitCommandOptions options) { CommonHelper.CheckAdministrativePrivileges(); var commandContext = new InitCommandContext { CommandOptions = options }; var commandTransaction = new CommandTransactionManager <InitCommandContext>(_log) .Stage(Resources.InitCommandHandler_FindAppInstallations, FindAppInstallations) .Stage(Resources.InitCommandHandler_StartAppInitialization, StartAppInitialization); await commandTransaction.Execute(commandContext); }