Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/dotnetcore/CAP
Browse files Browse the repository at this point in the history
  • Loading branch information
yang-xiaodong committed Oct 9, 2022
2 parents bbcb545 + a67f9bc commit 702afed
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build/version.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<VersionMajor>6</VersionMajor>
<VersionMinor>1</VersionMinor>
<VersionMinor>2</VersionMinor>
<VersionPatch>1</VersionPatch>
<VersionQuality></VersionQuality>
<VersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ private static async Task TryGetOrCreateStreamGroupAsync(this IDatabase database
var groupInfo = await database.StreamGroupInfoAsync(stream);
if (groupInfo.Any(g => g.Name == consumerGroup))
return;

await database.StreamCreateConsumerGroupAsync(stream, consumerGroup, StreamPosition.NewMessages)
.ConfigureAwait(false);
}
catch (Exception ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ protected virtual IEnumerable<ConsumerExecutorDescriptor> FindConsumersFromInter
var executorDescriptorList = new List<ConsumerExecutorDescriptor>();

var capSubscribeTypeInfo = typeof(ICapSubscribe).GetTypeInfo();
var serviceCollection = provider.GetRequiredService<IServiceCollection>();

using var scope = provider.CreateScope();
var scopeProvider = scope.ServiceProvider;

var serviceCollection = scopeProvider.GetRequiredService<IServiceCollection>();

foreach (var service in serviceCollection
.Where(o => o.ImplementationType != null || o.ImplementationFactory != null))
Expand All @@ -91,7 +95,7 @@ protected virtual IEnumerable<ConsumerExecutorDescriptor> FindConsumersFromInter
var actualType = service.ImplementationType;
if (actualType == null && service.ImplementationFactory != null)
{
actualType = provider.GetRequiredService(service.ServiceType).GetType();
actualType = scopeProvider.GetRequiredService(service.ServiceType).GetType();
}

if (actualType == null)
Expand Down

0 comments on commit 702afed

Please sign in to comment.