Skip to content

Commit 084b002

Browse files
committed
fix(Runner): Fixed the Do, For and Try TaskExecutors to used Metadata instead of Extensions, which has been removed in latest SDK version
Signed-off-by: Charles d'Avernas <[email protected]>
1 parent b3bea55 commit 084b002

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/core/Synapse.Core/SynapseDefaults.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1065,9 +1065,9 @@ public static class Tasks
10651065
{
10661066

10671067
/// <summary>
1068-
/// Exposes Synapse task extension properties
1068+
/// Exposes Synapse task metadata properties
10691069
/// </summary>
1070-
public static class ExtensionProperties
1070+
public static class Metadata
10711071
{
10721072

10731073
/// <summary>

src/runner/Synapse.Runner/Services/Executors/DoTaskExecutor.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class DoTaskExecutor(IServiceProvider serviceProvider, ILogger<DoTaskExec
4040
/// <param name="index">The index of the subtask to get the path to</param>
4141
/// <param name="name">The name of the subtask to get the path to</param>
4242
/// <returns>The path to the specified subtask</returns>
43-
protected virtual string GetPathFor(int index, string name) => this.Task.Definition.Extensions?.TryGetValue(SynapseDefaults.Tasks.ExtensionProperties.PathPrefix.Name, out var value) == true && value is bool prefix && prefix == false
43+
protected virtual string GetPathFor(int index, string name) => this.Task.Definition.Metadata?.TryGetValue(SynapseDefaults.Tasks.Metadata.PathPrefix.Name, out var value) == true && value is bool prefix && prefix == false
4444
? $"{index}/{name}"
4545
: $"{nameof(DoTaskDefinition.Do).ToCamelCase()}/{index}/{name}";
4646

src/runner/Synapse.Runner/Services/Executors/ForTaskExecutor.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ protected override async Task DoExecuteAsync(CancellationToken cancellationToken
7878
var taskDefinition = new DoTaskDefinition()
7979
{
8080
Do = this.Task.Definition.Do,
81-
Extensions =
81+
Metadata =
8282
[
83-
new(SynapseDefaults.Tasks.ExtensionProperties.PathPrefix.Name, false)
83+
new(SynapseDefaults.Tasks.Metadata.PathPrefix.Name, false)
8484
]
8585
};
8686
if (task == null) task = await this.Task.Workflow.CreateTaskAsync(taskDefinition, this.GetPathFor("0"), this.Task.Input, null, this.Task, false, cancellationToken).ConfigureAwait(false);
@@ -134,9 +134,9 @@ protected virtual async Task OnIterationCompletedAsync(ITaskExecutor executor, C
134134
var taskDefinition = new DoTaskDefinition()
135135
{
136136
Do = this.Task.Definition.Do,
137-
Extensions =
137+
Metadata =
138138
[
139-
new(SynapseDefaults.Tasks.ExtensionProperties.PathPrefix.Name, false)
139+
new(SynapseDefaults.Tasks.Metadata.PathPrefix.Name, false)
140140
]
141141
};
142142
var next = await this.Task.Workflow.CreateTaskAsync(taskDefinition, this.GetPathFor(index.ToString()), output, null, this.Task, false, cancellationToken).ConfigureAwait(false);

src/runner/Synapse.Runner/Services/Executors/TryTaskExecutor.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ protected override async Task DoExecuteAsync(CancellationToken cancellationToken
3737
var taskDefinition = new DoTaskDefinition()
3838
{
3939
Do = this.Task.Definition.Try,
40-
Extensions =
40+
Metadata =
4141
[
42-
new(SynapseDefaults.Tasks.ExtensionProperties.PathPrefix.Name, false)
42+
new(SynapseDefaults.Tasks.Metadata.PathPrefix.Name, false)
4343
]
4444
};
4545
var task = await this.Task.Workflow.CreateTaskAsync(taskDefinition, nameof(this.Task.Definition.Try).ToCamelCase(), this.Task.Input, null, this.Task, false, cancellationToken).ConfigureAwait(false);
@@ -60,9 +60,9 @@ protected override async Task DoRetryAsync(Error cause, CancellationToken cancel
6060
var taskDefinition = new DoTaskDefinition()
6161
{
6262
Do = this.Task.Definition.Try,
63-
Extensions =
63+
Metadata =
6464
[
65-
new(SynapseDefaults.Tasks.ExtensionProperties.PathPrefix.Name, false)
65+
new(SynapseDefaults.Tasks.Metadata.PathPrefix.Name, false)
6666
]
6767
};
6868
var task = await this.Task.Workflow.CreateTaskAsync(taskDefinition, $"retry/{this.Task.Instance.Retries?.Count - 1}/try", this.Task.Input, null, this.Task, false, cancellationToken).ConfigureAwait(false);

0 commit comments

Comments
 (0)