do not create a new Scope - reuse workflowExecutionContext's scope (#2502)

* do not create a new Scope - reuse workflowExecutionContext's scope

* Upgrade Rebus.ServiceProvider to 7.0

Co-authored-by: Martin <mp@prakom.net>
This commit is contained in:
noxe 2021-11-19 20:57:28 +01:00 committed by GitHub
parent 76bb8a9eb6
commit 4cf53d7ff1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View file

@ -42,7 +42,7 @@
<PackageReference Include="Storage.Net" Version="9.3.0" />
<PackageReference Include="System.Linq.Async" Version="5.0.0" />
<PackageReference Include="System.Threading.Channels" Version="5.0.0" />
<PackageReference Include="Rebus.ServiceProvider" Version="6.4.1" />
<PackageReference Include="Rebus.ServiceProvider" Version="7.0.0" />
</ItemGroup>
<ItemGroup>

View file

@ -204,10 +204,8 @@ namespace Elsa.Services.Workflows
private async ValueTask<bool> CanExecuteAsync(WorkflowExecutionContext workflowExecutionContext, IActivityBlueprint activityBlueprint, bool resuming, CancellationToken cancellationToken)
{
using var scope = _serviceScopeFactory.CreateScope();
var activityExecutionContext = new ActivityExecutionContext(
scope.ServiceProvider,
workflowExecutionContext.ServiceProvider,
workflowExecutionContext,
activityBlueprint,
workflowExecutionContext.Input,