From 8e9c296014bdd178f0fdb8436820e594d18e007f Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Tue, 16 Apr 2024 12:02:01 +0200 Subject: [PATCH] fix: don't update cache for empty state --- services/repository/commitstatus/commitstatus.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/repository/commitstatus/commitstatus.go b/services/repository/commitstatus/commitstatus.go index cbe9d4cef..bd40a75dc 100644 --- a/services/repository/commitstatus/commitstatus.go +++ b/services/repository/commitstatus/commitstatus.go @@ -187,7 +187,7 @@ func FindReposLastestCommitStatuses(ctx context.Context, repos []*repo_model.Rep for i, repo := range repos { if results[i] == nil { results[i] = git_model.CalcCommitStatus(repoToItsLatestCommitStatuses[repo.ID]) - if results[i] != nil { + if results[i] != nil && results[i].State != "" { if err := updateCommitStatusCache(repo.ID, repo.DefaultBranch, results[i].State, results[i].TargetURL); err != nil { log.Error("updateCommitStatusCache[%d:%s] failed: %v", repo.ID, repo.DefaultBranch, err) }