Skip to content

Commit

Permalink
fix:update environment provider (#654)
Browse files Browse the repository at this point in the history
  • Loading branch information
MayueCif authored Jul 14, 2023
1 parent 52d5360 commit 3d0488f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,21 @@ public static class ServiceCollectionExtensions
{
public static async Task<IServiceCollection> AddStackIsolationAsync(this IServiceCollection services, string name)
{
services.AddIsolation(isolationBuilder => isolationBuilder.UseMultiEnvironment(IsolationConsts.ENVIRONMENT));
services.AddIsolation(isolationBuilder =>
{
isolationBuilder.UseMultiEnvironment(IsolationConsts.ENVIRONMENT);
isolationBuilder.UseMultiEnvironment(new List<IParserProvider>()
{
new HttpContextItemParserProvider(),
new QueryStringParserProvider(),
new FormParserProvider(),
new RouteParserProvider(),
new HeaderParserProvider(),
new CurrentUserEnvironmentParseProvider(),
new MasaAppConfigureParserProvider(),
new EnvironmentVariablesParserProvider()
});
});

var pmClient = services.BuildServiceProvider().GetRequiredService<IPmClient>();
var environments = (await pmClient.EnvironmentService.GetListAsync()).Select(e => e.Name).ToList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
global using Masa.Contrib.Configuration;
global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal.Parser;
global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Options;
global using Masa.Contrib.Isolation.MultiEnvironment;
global using Masa.Contrib.Isolation.Parser;
global using Masa.Contrib.StackSdks.Config;
global using Masa.Contrib.Storage.ObjectStorage.Aliyun;
global using Masa.Contrib.Storage.ObjectStorage.Aliyun.Options;
Expand Down

0 comments on commit 3d0488f

Please sign in to comment.