feat: implement batch data fetching and error handling in DataConnector #482
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #481
Improvements to data fetching:
apps/dashboard_app/data_connector.py
: Modified thefetch_data
method to support batch fetching with a newbatch_size
parameter. This allows for more efficient data retrieval by paginating the results.apps/dashboard_app/data_connector.py
: Added a new methodfetch_protocol_last_block_number
to fetch the last block number for a specific protocol, enhancing the flexibility of the data connector.Enhancements to error handling:
apps/dashboard_app/helpers/load_data.py
: Wrapped the data fetching and processing logic in atry
block within the_init_zklend_state
method to handle potential exceptions and log errors. This improves the robustness of the data initialization process.These changes collectively enhance the efficiency, flexibility, and reliability of the data handling processes within the application.