-
Notifications
You must be signed in to change notification settings - Fork 13
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
Cleanup sdk #1085
Cleanup sdk #1085
Conversation
dbf0ba4
to
b11a3d5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I add some comment but they should definitely done in another PR.
@@ -129,11 +127,11 @@ func (e *Execution) Execute(serviceHash hash.Hash, taskKey string, inputData map | |||
return nil, err | |||
} | |||
// a task should be executed only if task's service is running. | |||
status, err := e.m.Status(s) | |||
instances, err := e.instDB.GetAllByService(s.Hash) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should only access the instanceSDK instead of the DB!
return &Execution{ | ||
m: m, | ||
ps: ps, | ||
db: db, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The service DB should not be injected as a dependency, but the ServiceSDK should
Instance: instancesdk.New(c, db, instanceDB), | ||
Execution: executionsdk.New(m, ps, db, execDB), | ||
Execution: executionsdk.New(ps, db, execDB, instanceDB), | ||
Event: eventsdk.New(ps, db), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as previous comments.
Each SDK should have only access to its specific resource database (eg instance SDK accesses only instance DB, and so on) but can also access to "child" sdk based on the way the data are linked together (eg, instance SDK can access to service SDK because instance contains service hash).
9284459
to
4abd07a
Compare
4abd07a
to
ce914a9
Compare
Dependency #1083