Skip to content

refactor: combine signal retrieval and token rewards operations.#264

Merged
ardevd merged 2 commits into
mainfrom
token-rewards-in-parallel
Feb 26, 2026
Merged

refactor: combine signal retrieval and token rewards operations.#264
ardevd merged 2 commits into
mainfrom
token-rewards-in-parallel

Conversation

@ardevd

@ardevd ardevd commented Feb 25, 2026

Copy link
Copy Markdown
Owner

No description provided.

@ardevd ardevd self-assigned this Feb 25, 2026
Copilot AI review requested due to automatic review settings February 25, 2026 22:44
@ardevd ardevd added the enhancement New feature or request label Feb 25, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the signal retrieval and token rewards operations to execute concurrently using asyncio.gather, improving performance by fetching both datasets in parallel. The _update_token_rewards async method is converted to a synchronous _process_token_rewards method that processes pre-fetched data rather than fetching it itself.

Changes:

  • Combined signal and token rewards API calls to execute concurrently using asyncio.gather
  • Refactored _update_token_rewards from async method to sync _process_token_rewards that processes already-fetched data
  • Minor code quality improvements in dimo_client.py to avoid redundant dictionary access

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
custom_components/dimo/init.py Refactored to fetch signals and rewards concurrently; converted _update_token_rewards to sync _process_token_rewards method
custom_components/dimo/dimoapi/dimo_client.py Minor refactoring to eliminate redundant dictionary access and improve code readability
tests/test_init.py Updated test to reflect sync nature of _process_token_rewards; removed async decorator and updated mocking

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_init.py Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@redbird-sonarqube

Copy link
Copy Markdown

@ardevd ardevd merged commit 4c3abd3 into main Feb 26, 2026
6 checks passed
@ardevd ardevd deleted the token-rewards-in-parallel branch February 26, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants