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

Stop services when the daemon stops #187

Merged
merged 9 commits into from
Jun 5, 2018

Conversation

antho1404
Copy link
Member

In this PR I added a new label for docker services mesg.hash

With this label, we can now from a docker service retrieve the service in the database and do whatever we want. In this case just before stoping the daemon we can stop all the running services

fix #158

@antho1404 antho1404 self-assigned this Jun 3, 2018
@codecov
Copy link

codecov bot commented Jun 3, 2018

Codecov Report

Merging #187 into dev will increase coverage by 0.38%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             dev     #187      +/-   ##
=========================================
+ Coverage   74.2%   74.58%   +0.38%     
=========================================
  Files         57       57              
  Lines       1159     1157       -2     
=========================================
+ Hits         860      863       +3     
+ Misses       229      226       -3     
+ Partials      70       68       -2
Impacted Files Coverage Δ
service/start.go 78.12% <100%> (+0.7%) ⬆️
database/services/save.go 63.63% <100%> (+9.79%) ⬆️
service/status.go 100% <100%> (ø) ⬆️
service/hash.go 100% <100%> (ø) ⬆️
api/service/submit_result.go 87.5% <0%> (-4.81%) ⬇️
api/core/execute.go 86.66% <0%> (+2.05%) ⬆️
service/import.go 100% <0%> (+25%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a0ff405...89f3729. Read the comment docs.

@antho1404 antho1404 added application enhancement New feature or request labels Jun 4, 2018
…-services-when-daemon-stop

# Conflicts:
#	CHANGELOG.md
#	cmd/daemon/stop.go
#	examples/services/test-event
#	service/hash_test.go
#	service/start.go
}
for _, hash := range hashes {
// TODO: this function should be execute in a go routine. StopService is blocking
_, err := cli.StopService(context.Background(), &core.StopServiceRequest{
Copy link
Member

Choose a reason for hiding this comment

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

This should be called in a async fashion to stop all services at the same time.

@NicolasMahe
Copy link
Member

I updated daemon.stopServices function. Now it's calling cli.StopService in an async way in order to stop all services at the same time.

@NicolasMahe NicolasMahe merged commit d313837 into dev Jun 5, 2018
@NicolasMahe NicolasMahe deleted the 158-stop-services-when-daemon-stop branch June 5, 2018 08:15
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.

Stop services when stopping daemon
2 participants