Skip to content

Commit

Permalink
re-embed settings file
Browse files Browse the repository at this point in the history
  • Loading branch information
tybritten committed Aug 8, 2022
1 parent 15876ac commit 7305e10
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions indexers/contacts.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ import (
"fmt"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"io/ioutil"
"time"
)

//go:embed contacts.settings.json
var contactsSettingsFile []byte

var contactsSettings ElasticSettings

// ContactIndexer is an indexer for contacts
Expand Down Expand Up @@ -46,8 +48,7 @@ func (i *ContactIndexer) Index(db *sql.DB, rebuild, cleanup bool, shards int, re

// doesn't exist or we are rebuilding, create it
if physicalIndex == "" || rebuild {
file, _ := ioutil.ReadFile("contacts.settings.json")
_ = json.Unmarshal([]byte(file), &contactsSettings)
_ = json.Unmarshal(contactsSettingsFile, &contactsSettings)
contactsSettings.Settings.Index.NumberOfShards = shards
contactsSettings.Settings.Index.NumberOfReplicas = replicas
physicalIndex, err = i.createNewIndex(contactsSettings)
Expand Down

0 comments on commit 7305e10

Please sign in to comment.