File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
Service/GroupMembershipManagement/Hosts/WebApi/Services.WebApi Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -76,14 +76,32 @@ protected override async Task<GetJobsResponse> ExecuteCoreAsync(GetJobsRequest r
7676 foreach ( var job in jobs )
7777 {
7878 var type = job . Destination . Contains ( "GroupMembership" ) ? "Group" : "Channel" ;
79+ var currentTime = DateTime . UtcNow ;
80+ var jobStartsInFuture = currentTime < job . StartDate ;
81+ var jobScheduledForFuture = currentTime < job . ScheduledDate ;
82+
83+ DateTime estimatedNextRunTime ;
84+ if ( ! jobStartsInFuture && ! jobScheduledForFuture )
85+ {
86+ estimatedNextRunTime = job . LastRunTime . AddHours ( job . Period ) ;
87+ }
88+ else if ( jobStartsInFuture )
89+ {
90+ estimatedNextRunTime = job . StartDate ;
91+ }
92+ else
93+ {
94+ estimatedNextRunTime = job . ScheduledDate ;
95+ }
96+
7997 var dto = new SyncJobDTO
8098 (
8199 job . Id ,
82100 job . TargetOfficeGroupId ,
83101 job . Status ,
84102 job . Period ,
85103 job . LastSuccessfulRunTime ,
86- job . StartDate > job . ScheduledDate ? job . StartDate : job . ScheduledDate
104+ estimatedNextRunTime
87105 )
88106 {
89107 TargetGroupName = targetGroups . ContainsKey ( job . TargetOfficeGroupId ) ? targetGroups [ job . TargetOfficeGroupId ] . Name : null ,
You can’t perform that action at this time.
0 commit comments