Skip to content
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

Merged
merged 12 commits into from
Jul 11, 2020

Conversation

miiu96
Copy link
Contributor

@miiu96 miiu96 commented Jul 9, 2020

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.

@ccorcoveanu ccorcoveanu self-requested a review July 10, 2020 07:04
@bogdan-rosianu bogdan-rosianu self-requested a review July 10, 2020 07:05
@@ -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)),
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactored.

// update transaction
meta, serializedData = prepareTxUpdate(tx)
} else {
// write tx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this extra comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@miiu96 miiu96 marked this pull request as ready for review July 10, 2020 07:40
bogdan-rosianu
bogdan-rosianu previously approved these changes Jul 10, 2020
Copy link
Contributor

@LucianMincu LucianMincu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

System tests passed.

@LucianMincu LucianMincu merged commit 94a08bc into development Jul 11, 2020
@LucianMincu LucianMincu deleted the remove-get-from-elastic-indexer branch July 11, 2020 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants