Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "9.0.306",
"rollForward": "feature"
}
}
8 changes: 0 additions & 8 deletions src/ManagedCode.AgentLightning.AgentRuntime/LightningAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ public LightningAgent(
_timeProvider = timeProvider ?? TimeProvider.System;
}

public Task<LightningExecutionResult> ExecuteAsync(
object taskInput,
NamedResources? resources,
RolloutMode? mode = null,
string? resourcesId = null,
CancellationToken cancellationToken = default) =>
base.ExecuteAsync(taskInput, resources, mode, resourcesId, cancellationToken);

protected override async Task<LightningExecutionResult> RolloutAsync(
object taskInput,
NamedResources? resources,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public sealed class ActivityToSpanModelAdapter : OtelTraceAdapter<IReadOnlyList<
public ActivityToSpanModelAdapter(
string? defaultRolloutId = null,
string? defaultAttemptId = null,
int sequenceSeed = 1,
int sequenceSeed = 0,
IComparer<Activity>? ordering = null,
Func<Activity, Resource?>? resourceResolver = null)
{
Expand Down Expand Up @@ -132,14 +132,19 @@ private static bool TryConvertToInt(object value, out int result)
case long l when l is >= int.MinValue and <= int.MaxValue:
result = (int)l;
return true;
case string s when int.TryParse(s, NumberStyles.Integer, CultureInfo.InvariantCulture, out var parsed):
result = parsed;
return true;
case string s:
if (int.TryParse(s, NumberStyles.Integer, CultureInfo.InvariantCulture, out var parsedFromString))
{
result = parsedFromString;
return true;
}

break;
case IFormattable formattable:
var asString = formattable.ToString(null, CultureInfo.InvariantCulture);
if (int.TryParse(asString, NumberStyles.Integer, CultureInfo.InvariantCulture, out parsed))
if (int.TryParse(asString, NumberStyles.Integer, CultureInfo.InvariantCulture, out var parsedFromFormattable))
{
result = parsed;
result = parsedFromFormattable;
return true;
}

Expand Down
Loading