Skip to content

Commit

Permalink
minor edit
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmrdavid committed May 28, 2024
1 parent adea23e commit a8a732a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/WebJobs.Extensions.DurableTask/LocalGrpcListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,23 +157,24 @@ public override Task<Empty> Hello(Empty request, ServerCallContext context)
{
string instanceId = request.InstanceId ?? Guid.NewGuid().ToString("N");
TaskHubClient taskhubClient = new TaskHubClient(this.GetDurabilityProvider(context));
OrchestrationInstance instance;

// TODO: Ideally, we'd have a single method in the taskhubClient that can handle both scheduled and non-scheduled starts.
// TODO: the type of `ScheduledStartTimestamp` is not nullable. Can we change it to `DateTime?` in the proto file?
if (request.ScheduledStartTimestamp != null)
{
var ins = await taskhubClient.CreateScheduledOrchestrationInstanceAsync(
instance = await taskhubClient.CreateScheduledOrchestrationInstanceAsync(
name: request.Name, version: request.Version, instanceId: instanceId, input: Raw(request.Input), startAt: request.ScheduledStartTimestamp.ToDateTime());
}
else
{
await taskhubClient.CreateOrchestrationInstanceAsync(request.Name, request.Version, instanceId, Raw(request.Input));
instance = await taskhubClient.CreateOrchestrationInstanceAsync(request.Name, request.Version, instanceId, Raw(request.Input));
}

// TODO: should this not inclide the ExecutionId and other elements of the taskhubClient response?
// TODO: should this not include the ExecutionId and other elements of the taskhubClient response?
return new P.CreateInstanceResponse
{
InstanceId = instanceId,
InstanceId = instance.InstanceId,
};
}
catch (OrchestrationAlreadyExistsException)
Expand Down

0 comments on commit a8a732a

Please sign in to comment.