Skip to content

Commit d11fe5b

Browse files
fix: init cluster health default status to green avoid nil panic (#81)
* fix: init cluster health default status to green avoid nil panic * docs: add release notes
1 parent 5131afa commit d11fe5b

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

core/elastic/actions.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ func (meta *ElasticsearchMetadata) IsAvailable() bool {
126126

127127
func (meta *ElasticsearchMetadata) Init(health bool) {
128128
meta.clusterAvailable = health
129+
if health && meta.Health == nil {
130+
meta.Health = &ClusterHealth{Status: "green"}
131+
}
129132
meta.clusterFailureTicket = 0
130133
}
131134

docs/content.en/docs/release-notes/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Information about release notes of INFINI Framework is provided here.
1717
- Fixed `[]byte` operator when queue comsumer paic (#77)
1818
- Fix incorrect interval configuration in index stats collection task (#80)
1919
- Fixed reload file need use privious pos (#79)
20+
- Fixed nil panic by init cluster health default status to green (#81)
2021

2122

2223
### Improvements

0 commit comments

Comments
 (0)