Skip to content

Commit

Permalink
Fixed connection error when no token provided while connection does n…
Browse files Browse the repository at this point in the history
…ot require one
  • Loading branch information
Matthieu Vachon committed Apr 19, 2021
1 parent 6a0d0c8 commit 974a746
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion devel/standard/standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ start:
- tokenmeta
- trxdb-loader
flags:
common-exclude-filter-expr: (receiver == "eosio" && action == "onblock")
#common-exclude-filter-expr: (receiver == "eosio" && action == "onblock")
search-common-dfuse-events-action-name: dfuseiohooks:event
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
github.com/dfuse-io/dauth v0.0.0-20200601190857-60bc6a4b4665
github.com/dfuse-io/dbin v0.0.0-20200417174747-9a3806ff5643
github.com/dfuse-io/derr v0.0.0-20201001203637-4dc9d8014152
github.com/dfuse-io/dgraphql v0.0.2-0.20210412200810-081b8535f415
github.com/dfuse-io/dgraphql v0.0.2-0.20210419180229-1a7aa43fb666
github.com/dfuse-io/dgrpc v0.0.0-20210309152232-10776c4e5ec1
github.com/dfuse-io/dhammer v0.0.0-20200723173708-b7e52c540f64
github.com/dfuse-io/dipp v1.0.1-0.20200407033930-5c17c531c3c4
Expand All @@ -43,7 +43,7 @@ require (
github.com/dfuse-io/opaque v0.0.0-20210108174126-bc02ec905d48
github.com/dfuse-io/pbgo v0.0.6-0.20210125181705-b17235518132
github.com/dfuse-io/relayer v0.0.2-0.20201029161257-ec97edca50d7
github.com/dfuse-io/search v0.0.2-0.20210413183144-1078f4b41956
github.com/dfuse-io/search v0.0.2-0.20210419180107-1cc7385bf5f4
github.com/dfuse-io/search-client v0.0.0-20200602205137-71b300d129d2
github.com/dfuse-io/shutter v1.4.1
github.com/dfuse-io/validator v0.0.0-20200407012817-82c55c634c7a
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ github.com/dfuse-io/dgraphql v0.0.2-0.20210209213422-0c203cf6bcfd h1:eVewYg1V08k
github.com/dfuse-io/dgraphql v0.0.2-0.20210209213422-0c203cf6bcfd/go.mod h1:VXMflpeId/G6j7eiIbvMswWIomVV+Synsqp23TQqkVk=
github.com/dfuse-io/dgraphql v0.0.2-0.20210412200810-081b8535f415 h1:VrReQGtYwIp0qc2Td+E6Ik9zgtFEthEEImubXbCId8g=
github.com/dfuse-io/dgraphql v0.0.2-0.20210412200810-081b8535f415/go.mod h1:VXMflpeId/G6j7eiIbvMswWIomVV+Synsqp23TQqkVk=
github.com/dfuse-io/dgraphql v0.0.2-0.20210419180229-1a7aa43fb666 h1:MckLZF7OG+2upuDyUsfy5Wo4GYne/IcqAw4H82Cj4XQ=
github.com/dfuse-io/dgraphql v0.0.2-0.20210419180229-1a7aa43fb666/go.mod h1:VXMflpeId/G6j7eiIbvMswWIomVV+Synsqp23TQqkVk=
github.com/dfuse-io/dgrpc v0.0.0-20200406214416-6271093e544c/go.mod h1:n7pQV0mGBMBgJChGKp5gfRLkP2jSCkT+to7fPxKvQPA=
github.com/dfuse-io/dgrpc v0.0.0-20200417124327-c8f215bc4ce5/go.mod h1:n7pQV0mGBMBgJChGKp5gfRLkP2jSCkT+to7fPxKvQPA=
github.com/dfuse-io/dgrpc v0.0.0-20200615163546-b8380f15f7d8/go.mod h1:LJXocN3Yp8Kir8nhx0I65V9Qyw5g/NvXN+Wg7aF5Ujk=
Expand Down Expand Up @@ -369,6 +371,8 @@ github.com/dfuse-io/search v0.0.2-0.20210412202018-74f156a3fbed h1:ENrwtHr+tNqg6
github.com/dfuse-io/search v0.0.2-0.20210412202018-74f156a3fbed/go.mod h1:mKSf+fJmFkum7i3don5KLB15VDF8jGbp1u7lW1CsYnE=
github.com/dfuse-io/search v0.0.2-0.20210413183144-1078f4b41956 h1:HjQTeteW0cB4VoQkpBFOFgM3uoamzRWue6oPdoInqCM=
github.com/dfuse-io/search v0.0.2-0.20210413183144-1078f4b41956/go.mod h1:W+S7B/ndx5uT6UkZHDTduzeQGd99CTkeroKC73KYbM4=
github.com/dfuse-io/search v0.0.2-0.20210419180107-1cc7385bf5f4 h1:wPmIooAhTGhvz6Gz5uTv9vA288hQsMwnpOJh4KVeHYI=
github.com/dfuse-io/search v0.0.2-0.20210419180107-1cc7385bf5f4/go.mod h1:W+S7B/ndx5uT6UkZHDTduzeQGd99CTkeroKC73KYbM4=
github.com/dfuse-io/search-client v0.0.0-20200602205137-71b300d129d2 h1:epRDGOCi8YAqcI3cZdXgbFowZh8L/rSENwi2hQqzipo=
github.com/dfuse-io/search-client v0.0.0-20200602205137-71b300d129d2/go.mod h1:TY7lgsDrNonQ7nUtwGK4En08cuG7eRrV743DZozvehk=
github.com/dfuse-io/shutter v1.4.1-0.20200319040708-c809eec458e6/go.mod h1:2mLf0v+n8J8NI7F6L6avYaRNfa6XECB6CP3WO8rRx88=
Expand Down
3 changes: 2 additions & 1 deletion search/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import (
"go.uber.org/zap"
)

var traceEnabled = logging.IsTraceEnabled("search", "github.com/dfuse-io/dfuse-eosio/search")
var zlog *zap.Logger

func init() {
logging.Register("github.com/dfuse-io/dfuse-eosio/search/", &zlog)
logging.Register("github.com/dfuse-io/dfuse-eosio/search", &zlog)
}
8 changes: 8 additions & 0 deletions search/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ func (m *BlockMapper) Map(block *bstream.Block) ([]*document.Document, error) {
var docsList []*document.Document
batchActionUpdater := func(trxID string, idx int, data map[string]interface{}) error {
doc := document.NewDocument(newDocumentID(blk.Num(), trxID, idx))
if traceEnabled {
zlog.Debug("adding document to docs list", zap.String("id", doc.ID), zap.Int("size", doc.Size()), zap.Reflect("data", data))
}

err := m.MapDocument(doc, data)
if err != nil {
return err
Expand Down Expand Up @@ -209,6 +213,10 @@ func (m *BlockMapper) prepareBatchDocuments(blk *pbcodec.Block, batchUpdater Bat
}

// Loop and batch update all the actions
if traceEnabled {
zlog.Debug("mapped block to documents", zap.Int("action_count", len(tokenizedActions)), zap.Stringer("block", blk.AsRef()))
}

for _, doc := range tokenizedActions {
err := batchUpdater(doc.trxID, doc.idx, doc.data)
if err != nil {
Expand Down

0 comments on commit 974a746

Please sign in to comment.