Skip to content

Commit

Permalink
fix: domain
Browse files Browse the repository at this point in the history
  • Loading branch information
yuaanlin committed Oct 24, 2024
1 parent 3fe45aa commit b57290a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions internal/cmd/template/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func runDeploy(f *cmdutil.Factory, opts *Options) error {

f.Log.Infof("Template successfully deployed into project %q (https://dash.zeabur.com/projects/%s).", res.Name, res.ID)

if d, ok := vars["PUBLIC_DOMAIN"]; ok {
if d, ok := vars["PUBLIC_DOMAIN"]; ok && len(project.Region.ID) == 4 && project.Region.ID != "sha1" {
s = spinner.New(cmdutil.SpinnerCharSet, cmdutil.SpinnerInterval,
spinner.WithColor(cmdutil.SpinnerColor),
spinner.WithSuffix(" Waiting service status ..."),
Expand All @@ -206,14 +206,14 @@ func runDeploy(f *cmdutil.Factory, opts *Options) error {
}

time.Sleep(2 * time.Second)
get, err := http.Get(fmt.Sprintf("https://%s.zeabur.app/", d))
get, err := http.Get(fmt.Sprintf("https://%s.%s.zeabur.app/", d, project.Region.ID))
if err != nil {
continue
}

if get.StatusCode%100 != 5 {
s.Stop()
f.Log.Infof("Service ready, you can now visit via https://%s.zeabur.app/", d)
f.Log.Infof("Service ready, you can now visit via https://%s.%s.zeabur.app/", d, project.Region.ID)
break
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/api/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (c *client) CheckDomainAvailable(ctx context.Context, domain string, isGene
CheckDomainAvailable struct {
IsAvailable bool
Reason string
} `graphql:"checkDomainAvailable(domain: $domain, isGenerated: $isGenerated)"`
} `graphql:"checkDomainAvailable(domain: $domain, isGenerated: $isGenerated, region: $region)"`
}

err := c.Mutate(ctx, &mutation, V{
Expand Down

0 comments on commit b57290a

Please sign in to comment.