-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove get from elastic indexer #2085
Conversation
core/indexer/common.go
Outdated
@@ -198,7 +198,7 @@ func (cm *commonProcessor) convertScResultInDatabaseScr(sc *smartContractResult. | |||
Code: string(sc.Code), | |||
Data: decodedData, | |||
PreTxHash: hex.EncodeToString(sc.PrevTxHash), | |||
CallType: string(sc.CallType), | |||
CallType: string(rune(sc.CallType)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we cast to rune?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because for the moment call type is a strange character. also golang suggestion to use rune
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't callType integer (0, 1, 2)? if you save it as string (utf8) of course callType will be a strange character. You should save it like this I think :) strconv.Itoa(sc.CallType)
, this way you will get the correct value into the database (or better save it as integer in the json)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactored.
core/indexer/common.go
Outdated
// update transaction | ||
meta, serializedData = prepareTxUpdate(tx) | ||
} else { | ||
// write tx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this extra comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
… into remove-get-from-elastic-indexer
… into remove-get-from-elastic-indexer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System tests passed.
Removed all GET requests from elasticsearch observers to elasticsearch database.
Now all observers index data without checking if data for transaction and miniblocks are already in database.