Skip to content
Merged
Changes from 1 commit
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
Next Next commit
Fixed bug when setting point in time - this has to be set against Due…
…Time property and not Schedule

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
  • Loading branch information
WhitWaldo committed Feb 10, 2025
commit 1abb647f0aac7422a20de3171c6bd6f9ebe9cec1
15 changes: 12 additions & 3 deletions src/Dapr.Jobs/DaprJobsGrpcClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,22 @@ public override async Task ScheduleJobAsync(string jobName, DaprJobSchedule sche
ArgumentNullException.ThrowIfNull(jobName, nameof(jobName));
ArgumentNullException.ThrowIfNull(schedule, nameof(schedule));

var job = new Autogenerated.Job { Name = jobName, Schedule = schedule.ExpressionValue };
var job = new Autogenerated.Job { Name = jobName };

if (startingFrom is not null)
//Set up the schedule (recurring or point in time)
if (schedule.IsPointInTimeExpression)
{
job.DueTime = schedule.ExpressionValue;
}
else if (schedule.IsCronExpression || schedule.IsDurationExpression || schedule.IsPrefixedPeriodExpression)
{
job.Schedule = schedule.ExpressionValue;
}
else if (startingFrom is not null)
{
job.DueTime = ((DateTimeOffset)startingFrom).ToString("O");
}

if (repeats is not null)
{
if (repeats < 0)
Expand Down