Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
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
13 changes: 9 additions & 4 deletions pkg/commands/compute/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ import (
"strings"
"time"

"github.com/fastly/go-fastly/v8/fastly"
"github.com/kennygrant/sanitize"
"github.com/mholt/archiver/v3"

"github.com/fastly/cli/pkg/api"
"github.com/fastly/cli/pkg/api/undocumented"
"github.com/fastly/cli/pkg/cmd"
Expand All @@ -24,9 +28,6 @@ import (
"github.com/fastly/cli/pkg/manifest"
"github.com/fastly/cli/pkg/text"
"github.com/fastly/cli/pkg/undo"
"github.com/fastly/go-fastly/v8/fastly"
"github.com/kennygrant/sanitize"
"github.com/mholt/archiver/v3"
)

const (
Expand Down Expand Up @@ -202,6 +203,8 @@ func (c *DeployCommand) Exec(in io.Reader, out io.Writer) (err error) {
return nil
}

// validStatusCodeRange checks the status is a valid status code.
// e.g. >= 100 and <= 999
func validStatusCodeRange(status int) bool {
if status >= 100 && status <= 999 {
return true
Expand Down Expand Up @@ -1255,9 +1258,11 @@ func checkingServiceAvailability(
}
}

// generateTimeout inserts a dynamically generated message on each tick.
// It notifies the user what's happening and how long is left on the timer.
func generateTimeout(d time.Duration) string {
remaining := fmt.Sprintf("timeout: %v", d.Round(time.Second))
return fmt.Sprintf(" (app is being deployed across Fastly's global network | %s)...", remaining)
return fmt.Sprintf(" (app deploying across Fastly's global network | %s)...", remaining)
}

// pingServiceURL indicates if the service returned a non-5xx response (or
Expand Down