public async Task HandleEventAsync(UpdateFileConfigurationEventEventData eventData) { Name = eventData.Name; if (eventData.Name == _option.GatewayName) { var config = await _abpFileConfigurationRepository.GetFileConfiguration(eventData.Name); await _fileConfigurationRepository.Set(config); } }
public async Task HandleEventAsync(UpdateFileConfigurationEventEventData eventData) { Name = eventData.Name; if (eventData.Name == _option.GatewayName) { _logger.LogInformation($"gateway name: {eventData.Name} reload sucess."); var fileConfiguration = await _abpFileConfigurationRepository.GetFileConfiguration(eventData.Name); var config = await _internalConfigCreator.Create(fileConfiguration); if (!config.IsError) { _internalConfigRepo.AddOrReplace(config.Data); } await _fileConfigurationRepository.Set(fileConfiguration); } }
public async Task <Response <FileConfiguration> > Get() { var config = _cache.Get(_option.CachePrefix + "FileConfiguration", ""); if (config != null) { return(new OkResponse <FileConfiguration>(config)); } var file = await _abpFileConfigurationRepository.GetFileConfiguration(_option.GatewayName); if (file.Routes == null || file.Routes.Count == 0) { return(new OkResponse <FileConfiguration>(null)); } _logger.LogDebug(JsonConvert.SerializeObject(file)); return(new OkResponse <FileConfiguration>(file)); }