Skip to content

Commit

Permalink
fix: added InitializePluginJobRunnerAsync to the workflow option
Browse files Browse the repository at this point in the history
  • Loading branch information
pksorensen committed Aug 28, 2024
1 parent d25d182 commit d659652
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ public class WorkflowEndpointOptions

public Func<EAVDBContext,Guid, IWorkflowRun> RunFactory { get; set; }
public string WorkflowEntityName { get; set; }

public Func<IServiceProvider, string, Task> InitializePluginJobRunnerAsync { get; set; } = (sp, entityType) => Task.CompletedTask;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using EAVFramework.Endpoints;
using EAVFramework.Plugins;
using EAVFramework.Shared;
using EAVFW.Extensions.WorkflowEngine.Endpoints;
using Hangfire;
using Hangfire.Server;
using Microsoft.EntityFrameworkCore.ChangeTracking;
Expand Down Expand Up @@ -62,8 +63,9 @@ public async Task ExecuteAsync(string entityType, RecordKeys keys, HangFirePlugi
try
{
_logger.LogInformation("Starting execution of async plugin");
var options = _serviceProvider.GetRequiredService<IOptions<WorkflowEndpointOptions>>();

await data.Plugin.InitializePluginJobRunnerAsync(_serviceProvider, entityType);
await options.Value.InitializePluginJobRunnerAsync(_serviceProvider, entityType);

var db = _serviceProvider.GetRequiredService<EAVDBContext<TContext>>();

Expand Down

0 comments on commit d659652

Please sign in to comment.