Address code review comment

This commit is contained in:
Lawrence Wong 2023-01-25 14:56:02 -08:00
parent e90cc84f8c
commit b26290d922
4 changed files with 95 additions and 52 deletions

View file

@ -6,7 +6,7 @@ import (
"github.com/aurora-scheduler/gorealis/v2/gen-go/apache/aurora"
)
func (r *Client) jobExists(key aurora.JobKey) (bool, error) {
func (r *Client) JobExists(key aurora.JobKey) (bool, error) {
resp, err := r.client.GetConfigSummary(context.TODO(), &key)
if err != nil {
return false, err
@ -16,6 +16,8 @@ func (r *Client) jobExists(key aurora.JobKey) (bool, error) {
resp.GetResult_() == nil ||
resp.GetResult_().GetConfigSummaryResult_() == nil ||
resp.GetResult_().GetConfigSummaryResult_().GetSummary() == nil ||
resp.GetResult_().GetConfigSummaryResult_().GetSummary().GetGroups() == nil ||
len(resp.GetResult_().GetConfigSummaryResult_().GetSummary().GetGroups()) == 0 ||
resp.GetResponseCode() != aurora.ResponseCode_OK),
nil
}