Skip to content

Commit 34f304d

Browse files
authored
fix(api): notification as code duplicates (#5194)
1 parent 3973d0e commit 34f304d

File tree

4 files changed

+383
-4
lines changed

4 files changed

+383
-4
lines changed

engine/api/workflow/dao_node_run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ func GetNodeRunBuildCommits(ctx context.Context, db gorp.SqlExecutor, store cach
607607
}
608608
if br != nil {
609609
if br.LatestCommit == "" {
610-
return nil, cur, sdk.WrapError(sdk.ErrNoBranch, "branch %s or latest commit not found", cur.Branch)
610+
return nil, cur, sdk.WrapError(sdk.ErrNoBranch, "branch %s latest commit not found", cur.Branch)
611611
}
612612

613613
//and return the last commit of the branch

engine/api/workflow/execute_node_run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ func getVCSInfos(ctx context.Context, db gorp.SqlExecutor, store cache.Store, pr
10381038
if err != nil {
10391039
log.Error(ctx, "cannot get from cache %s: %v", cacheKey, err)
10401040
}
1041-
if find {
1041+
if find && vcsInfos.Branch != "" && vcsInfos.Hash != "" {
10421042
log.Debug("completeVCSInfos> load from cache: %s", cacheKey)
10431043
return &vcsInfos, nil
10441044
}

0 commit comments

Comments
 (0)