Skip to content
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 @@ -1088,6 +1088,7 @@ $ scw inspect myserver | jq '.[0].public_ip.address'

#### Features

* Syncing cache to disk after server creation when running `scw run` in a non-detached mode
* Bump to Golang 1.5
* Support --tmp-ssh-key `scw {run,create}` option ([#99](https://github.com/scaleway/scaleway-cli/issues/99))
* Support -f `scw run --rm` option ([#117](https://github.com/scaleway/scaleway-cli/issues/117))
Expand Down
3 changes: 3 additions & 0 deletions pkg/api/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"sync"

"github.com/scaleway/scaleway-cli/vendor/code.google.com/p/go-uuid/uuid"
"github.com/scaleway/scaleway-cli/vendor/github.com/Sirupsen/logrus"
"github.com/scaleway/scaleway-cli/vendor/github.com/renstrom/fuzzysearch/fuzzy"
)

Expand Down Expand Up @@ -177,6 +178,8 @@ func (c *ScalewayCache) Save() error {
c.Lock.Lock()
defer c.Lock.Unlock()

logrus.Debugf("Writing cache file to disk")

if c.Modified {
file, err := ioutil.TempFile("", "")
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions pkg/commands/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ func Run(ctx CommandContext, args RunArgs) error {
if args.Detach {
fmt.Fprintln(ctx.Stdout, serverID)
return nil
} else {
// Sync cache on disk
ctx.API.Sync()
}

if args.Attach {
Expand Down