Fix merge issue
This commit is contained in:
parent
8ca21ead16
commit
f3beca94dc
|
|
@ -1,33 +0,0 @@
|
|||
using Elsa.Mediator.Contracts;
|
||||
using Elsa.Python.Notifications;
|
||||
using Elsa.Python.Options;
|
||||
using JetBrains.Annotations;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace Elsa.Python.Handlers;
|
||||
|
||||
/// <summary>
|
||||
/// This handler configures the Python engine based on the <see cref="PythonOptions"/>.
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
public class ConfigurePythonFromOptions : INotificationHandler<EvaluatingPython>
|
||||
{
|
||||
private readonly PythonOptions _options;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ConfigurePythonFromOptions"/> class.
|
||||
/// </summary>
|
||||
public ConfigurePythonFromOptions(IOptions<PythonOptions> options)
|
||||
{
|
||||
_options = options.Value;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task HandleAsync(EvaluatingPython notification, CancellationToken cancellationToken)
|
||||
{
|
||||
foreach (var script in _options.Scripts)
|
||||
notification.AppendScript(script);
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue