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

Scheduler: Refactor nodedb create node #3970

Merged
merged 6 commits into from
Sep 28, 2024
Merged

Conversation

robertdavidsmith
Copy link
Collaborator

@robertdavidsmith robertdavidsmith commented Sep 25, 2024

Function nodedb.NodeDb.create currently does two things

  • Converts schedulerobjects.Node into internaltypes.Node
  • Add the node to the db

This PR breaks nodedb.NodeDb.create into two, so instead

  • Node conversion is done by internaltypes.Node.FromSchedulerObjectsNode.
  • Adding to the nodedb is done by nodedb.NodeDb.AddNodeToDb.

Going forward this will allow us to gradually replace schedulerobjects.Node with internaltypes.Node. Eventually FromSchedulerObjectsNode can be called straight after loading the node from the db, and the scheduler can use only internaltypes.Node internally.

@robertdavidsmith robertdavidsmith marked this pull request as draft September 25, 2024 22:36
robertdavidsmith and others added 4 commits September 26, 2024 10:41
Signed-off-by: Robert Smith <robertdavidsmith@yahoo.com>
Signed-off-by: Robert Smith <robertdavidsmith@yahoo.com>
Signed-off-by: Robert Smith <robertdavidsmith@yahoo.com>
@robertdavidsmith robertdavidsmith marked this pull request as ready for review September 27, 2024 13:49
@robertdavidsmith robertdavidsmith enabled auto-merge (squash) September 27, 2024 13:50
@robertdavidsmith robertdavidsmith changed the title Scheduler: Refactor create node Scheduler: Refactor nodedb create node Sep 27, 2024
@robertdavidsmith robertdavidsmith merged commit 5910a4b into master Sep 28, 2024
20 checks passed
@robertdavidsmith robertdavidsmith deleted the refactor-create-node branch September 28, 2024 19:24
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.

2 participants