summaryrefslogtreecommitdiff
path: root/create.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-01 00:41:00 -0500
committerJeff Carr <[email protected]>2024-11-01 00:41:00 -0500
commitc1d86fc324671995ee6dc279c7568bceda1cc910 (patch)
treeb7ba69757e251da753780cf6a8a8b1e8e60a2d75 /create.go
parent26cd0f7709ba552b98aeee83723612eb5e7009cb (diff)
common d.SprintHeader() functions for humans
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'create.go')
-rw-r--r--create.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/create.go b/create.go
index d77daad..9752bb2 100644
--- a/create.go
+++ b/create.go
@@ -9,7 +9,6 @@ import (
"time"
"github.com/google/uuid"
- "go.wit.com/lib/gui/shell"
pb "go.wit.com/lib/protobuf/virtbuf"
"go.wit.com/log"
)
@@ -35,7 +34,7 @@ func create(w http.ResponseWriter, r *http.Request) (string, error) {
}
}
d.StartState = pb.DropletState_OFF
- d.Current.State = pb.DropletState_OFF
+ d.SetState(pb.DropletState_OFF)
d.Memory = 2048 * 1024 * 1024
d.Cpus = 2
@@ -106,9 +105,9 @@ func startDroplet(d *pb.Droplet) (string, error) {
// how long has the cluster been stable?
// wait until it is stable. use this to throttle droplet starts
dur := time.Since(me.unstable)
- result = fmt.Sprintln("should start droplet", name, "here. grid stable for:", shell.FormatDuration(dur))
+ result = fmt.Sprintln("should start droplet", name, "here. grid stable for:", pb.FormatDuration(dur))
if dur < me.unstableTimeout {
- tmp := shell.FormatDuration(me.unstableTimeout)
+ tmp := pb.FormatDuration(me.unstableTimeout)
result += "grid is still too unstable (unstable timeout = " + tmp + ")"
return result, errors.New("grid is still unstable")
}