Skip to content

Commit

Permalink
[YUNIKORN-2835] Refactor switch statement in UpdateApplication (#901)
Browse files Browse the repository at this point in the history
Closes: #901

Signed-off-by: Wilfred Spiegelenburg <[email protected]>
  • Loading branch information
blueBlue0102 authored and wilfred-s committed Aug 27, 2024
1 parent 5bb3890 commit 2ce8431
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pkg/cache/scheduler_callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,9 @@ func (callback *AsyncRMCallback) UpdateApplication(response *si.ApplicationRespo
ev := NewResumingApplicationEvent(updated.ApplicationID)
dispatcher.Dispatch(ev)
}
default:
if updated.State == ApplicationStates().Failing || updated.State == ApplicationStates().Failed {
ev := NewFailApplicationEvent(updated.ApplicationID, updated.Message)
dispatcher.Dispatch(ev)
}
case ApplicationStates().Failing, ApplicationStates().Failed:
ev := NewFailApplicationEvent(updated.ApplicationID, updated.Message)
dispatcher.Dispatch(ev)
}
}
return nil
Expand Down

0 comments on commit 2ce8431

Please sign in to comment.