Skip to content

Commit

Permalink
more minor scheduling bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
garethgeorge committed Aug 27, 2024
1 parent d91c0a5 commit 9afbe4f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/orchestrator/tasks/taskbackup.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (t *BackupTask) Next(now time.Time, runner TaskRunner) (ScheduledTask, erro
if op.Status == v1.OperationStatus_STATUS_PENDING || op.Status == v1.OperationStatus_STATUS_SYSTEM_CANCELLED {
return nil
}
if _, ok := op.Op.(*v1.Operation_OperationBackup); ok {
if _, ok := op.Op.(*v1.Operation_OperationBackup); ok && op.UnixTimeEndMs != 0 {
lastRan = time.Unix(0, op.UnixTimeEndMs*int64(time.Millisecond))
return oplog.ErrStopIteration
}
Expand Down
2 changes: 1 addition & 1 deletion internal/orchestrator/tasks/taskcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (t *CheckTask) Next(now time.Time, runner TaskRunner) (ScheduledTask, error
if op.Status == v1.OperationStatus_STATUS_PENDING || op.Status == v1.OperationStatus_STATUS_SYSTEM_CANCELLED {
return nil
}
if _, ok := op.Op.(*v1.Operation_OperationCheck); ok {
if _, ok := op.Op.(*v1.Operation_OperationCheck); ok && op.UnixTimeEndMs != 0 {
lastRan = time.Unix(0, op.UnixTimeEndMs*int64(time.Millisecond))
return oplog.ErrStopIteration
}
Expand Down
2 changes: 1 addition & 1 deletion internal/orchestrator/tasks/taskprune.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (t *PruneTask) Next(now time.Time, runner TaskRunner) (ScheduledTask, error
if op.Status == v1.OperationStatus_STATUS_PENDING || op.Status == v1.OperationStatus_STATUS_SYSTEM_CANCELLED {
return nil
}
if _, ok := op.Op.(*v1.Operation_OperationPrune); ok {
if _, ok := op.Op.(*v1.Operation_OperationPrune); ok && op.UnixTimeEndMs != 0 {
lastRan = time.Unix(0, op.UnixTimeEndMs*int64(time.Millisecond))
return oplog.ErrStopIteration
}
Expand Down
7 changes: 4 additions & 3 deletions webui/src/state/flowdisplayaggregator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ export const displayInfoForFlow = (ops: Operation[]): FlowDisplayInfo => {

const duration = Number(firstOp.unixTimeEndMs - firstOp.unixTimeStartMs);

if (firstOp.status === OperationStatus.STATUS_PENDING) {
info.subtitleComponents.push("scheduled, waiting");
}

switch (firstOp.op.case) {
case "operationBackup":
{
Expand Down Expand Up @@ -93,9 +97,6 @@ export const displayInfoForFlow = (ops: Operation[]): FlowDisplayInfo => {
info.subtitleComponents.push(`ID: ${normalizeSnapshotId(snapshot.id)}`);
default:
switch (firstOp.status) {
case OperationStatus.STATUS_PENDING:
info.subtitleComponents.push("scheduled, waiting");
break;
case OperationStatus.STATUS_INPROGRESS:
info.subtitleComponents.push("running");
break;
Expand Down

0 comments on commit 9afbe4f

Please sign in to comment.