Update MongoDb collection service retrieval (#5083)
The previous implementation used the generic MongoCollectionBase service to retrieve workflow definition and instance collections. Now, the code has been updated to use IMongoCollection specifically designed for WorkflowDefinition and WorkflowInstance. This change ensures better typing and possibly performance improvements.
This commit is contained in:
parent
c1d0e7a0a2
commit
a4a05dcbf9
|
|
@ -27,7 +27,7 @@ internal class CreateIndices : IHostedService
|
|||
|
||||
private static Task CreateWorkflowDefinitionIndices(IServiceScope serviceScope, CancellationToken cancellationToken)
|
||||
{
|
||||
var workflowDefinitionCollection = serviceScope.ServiceProvider.GetService<MongoCollectionBase<WorkflowDefinition>>();
|
||||
var workflowDefinitionCollection = serviceScope.ServiceProvider.GetService<IMongoCollection<WorkflowDefinition>>();
|
||||
if (workflowDefinitionCollection == null) return Task.CompletedTask;
|
||||
|
||||
return IndexHelpers.CreateAsync(
|
||||
|
|
@ -51,7 +51,7 @@ internal class CreateIndices : IHostedService
|
|||
|
||||
private static Task CreateWorkflowInstanceIndices(IServiceScope serviceScope, CancellationToken cancellationToken)
|
||||
{
|
||||
var workflowInstanceCollection = serviceScope.ServiceProvider.GetService<MongoCollectionBase<WorkflowInstance>>();
|
||||
var workflowInstanceCollection = serviceScope.ServiceProvider.GetService<IMongoCollection<WorkflowInstance>>();
|
||||
if (workflowInstanceCollection == null) return Task.CompletedTask;
|
||||
|
||||
return IndexHelpers.CreateAsync(
|
||||
|
|
@ -86,4 +86,5 @@ internal class CreateIndices : IHostedService
|
|||
},
|
||||
cancellationToken));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue