Skip to content

stop sleeping :) #6

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

Merged
merged 2 commits into from
Apr 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ $> curl --silent http://212.47.248.251 | head -n1 # you can also open your brows

### master (unreleased)

* Sleep only when we stop an host ([#4](https://github.com/scaleway/docker-machine-driver-scaleway/issues/4))
* Support of `create`
* Support of `start`
* Support of `stop`
Expand Down
6 changes: 5 additions & 1 deletion driver/scaleway.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type Driver struct {
Token string
commercialType string
name string
stopping bool
// size string
// userDataFile string
// ipv6 bool
Expand Down Expand Up @@ -178,7 +179,9 @@ func (d *Driver) GetState() (st state.State, err error) {
case "stopped":
st = state.Stopped
}
time.Sleep(5 * time.Second)
if d.stopping {
time.Sleep(5 * time.Second)
}
return
}

Expand Down Expand Up @@ -240,5 +243,6 @@ func (d *Driver) Start() error {

// Stop stops the server
func (d *Driver) Stop() error {
d.stopping = true
return d.postAction("poweroff")
}