Skip to content

Commit 8cfea9f

Browse files
committed
scw run ... waits for 30 seconds before polling the API
1 parent b846037 commit 8cfea9f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,7 @@ Same as Hack, without step 5
958958

959959
#### Fixes
960960

961+
* `scw run ...` waits for 30 seconds before polling the API
961962
* `scw stop server1 server2` doesn't exit on first stopping failure
962963
* `scw run IMAGE [COMMAND]`, default *COMMAND* is now `if [ -x /bin/bash ]; then exec /bin/bash; else exec /bin/sh; fi`
963964

commands/run.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package commands
66

77
import (
88
"os"
9+
"time"
910

1011
log "github.com/Sirupsen/logrus"
1112

@@ -70,6 +71,8 @@ func runRun(cmd *types.Command, args []string) {
7071

7172
// waiting for server to be ready
7273
log.Debugf("Waiting for server to be ready")
74+
// We wait for 30 seconds, which is the minimal amount of time needed by a server to boot
75+
time.Sleep(30 * time.Second)
7376
server, err := api.WaitForServerReady(cmd.API, serverID)
7477
if err != nil {
7578
log.Fatalf("Cannot get access to server %s: %v", serverID, err)

0 commit comments

Comments
 (0)