Skip to content

Commit 0ab4fed

Browse files
committed
more logging of physical indexes
1 parent a837389 commit 0ab4fed

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: cmd/rp-indexer/main.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ func main() {
4848
}
4949

5050
physicalIndexes := indexer.FindPhysicalIndexes(config.ElasticURL, config.Index)
51+
log.WithField("physicalIndexes", physicalIndexes).WithField("index", config.Index).Info("found physical indexes")
5152
physicalIndex := ""
5253
if len(physicalIndexes) > 0 {
5354
physicalIndex = physicalIndexes[0]
@@ -58,8 +59,9 @@ func main() {
5859
if physicalIndex == "" || config.Rebuild {
5960
physicalIndex, err = indexer.CreateNewIndex(config.ElasticURL, config.Index)
6061
if err != nil {
61-
log.Fatal(err)
62+
log.WithError(err).Fatal("error creating new index")
6263
}
64+
log.WithField("index", config.Index).WithField("physicalIndex", physicalIndex).Info("created new physical index")
6365
}
6466

6567
for {
@@ -96,6 +98,7 @@ func main() {
9698
time.Sleep(time.Second * 5)
9799
physicalIndex = ""
98100
physicalIndexes = indexer.FindPhysicalIndexes(config.ElasticURL, config.Index)
101+
log.WithField("physicalIndexes", physicalIndexes).WithField("index", config.Index).Info("found physical indexes")
99102
if len(physicalIndex) > 0 {
100103
physicalIndex = physicalIndexes[0]
101104
}

0 commit comments

Comments
 (0)