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

Refactoring hydra_provider #113

Merged
merged 8 commits into from
Mar 29, 2024
Merged

Refactoring hydra_provider #113

merged 8 commits into from
Mar 29, 2024

Conversation

darrenrahnemoon
Copy link
Member

@darrenrahnemoon darrenrahnemoon commented Mar 7, 2024

Changes:

  • Data Feeds
    • Adds the ability to stop and start a data feed
    • Serial Data Feeds
      • Ability to see available serial ports available on the host
      • Ability to set a port on the fly
      • Ability to change the baud rate on the fly
    • Random Data Feeds
  • Commands
    • Set up the groundwork for command service

        - commands service
        - database service
        - serial data feed service
        - random data feed service
@darrenrahnemoon darrenrahnemoon changed the title feature: wip refactoring hydra_provider Refactoring hydra_provider Mar 19, 2024
@darrenrahnemoon darrenrahnemoon marked this pull request as ready for review March 19, 2024 16:56
Copy link
Member

@jonapap jonapap left a comment

Choose a reason for hiding this comment

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

Overall looking good! Left a few comments. Some are about things outside the scope of this PR. If you don't agree with those, just ignore them. Might have a second look later this week.

hydra_provider/src/data_feed_service/serial/iterator.rs Outdated Show resolved Hide resolved
hydra_provider/src/data_feed_service/serial/service.rs Outdated Show resolved Hide resolved
hydra_provider/src/data_feed_service/random/iterator.rs Outdated Show resolved Hide resolved
VALUES ($1, $2, $3)",
rocket_message_id,
format!("{:?}", self.level),
format!("{:?}", self.event)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
format!("{:?}", self.event)
format!("{}", self.event)

Not sure if this was tested and working with a Debug, but pretty sure Display should be used here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I forwarded this from the old code. I'm guessing it was tested? But we'll double check when we test this weekend :)

(rocket_message_id, level, event)
VALUES ($1, $2, $3)",
rocket_message_id,
format!("{:?}", self.level),
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick. While using Debug here is fine I suppose, it's usually not meant for a situation like this. Personally, I would manually map the log level to the desired string.

@seofernando25
Copy link
Collaborator

seofernando25 commented Mar 19, 2024

Also please run cargo fmt 👍
Thank you!

@seofernando25
Copy link
Collaborator

seofernando25 commented Mar 19, 2024

Oh I also deleted the .sqlx folder it is sometimes useful but it might cause the rust sql type completions to become stale.

Copy link
Collaborator

@seofernando25 seofernando25 left a comment

Choose a reason for hiding this comment

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

o7

if it works...

@seofernando25
Copy link
Collaborator

seofernando25 commented Mar 29, 2024

@darrenrahnemoon I have approved this PR some time ago.
Please merge it when you feel its ready 👍

@darrenrahnemoon
Copy link
Member Author

Yeah we can merge. I was gonna test it from the client side to see the data showing up properly but we can do it later I suppose.

@darrenrahnemoon darrenrahnemoon merged commit 34b66a5 into main Mar 29, 2024
@darrenrahnemoon darrenrahnemoon deleted the refactor/hydra-provider branch March 29, 2024 23:20
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.

4 participants