Skip to content

Commit d2d62af

Browse files
committed
fix: enable inproc porter by default
1 parent acf1269 commit d2d62af

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

internal/biz/bizsupervisor/instance.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"errors"
66
"math"
7+
"net/url"
78
"sync"
89
"time"
910

@@ -140,7 +141,7 @@ func (c *PorterInstanceController) UpdateStatus(ctx context.Context) *modelsuper
140141
// Initial state, load or create instance info.
141142
func (c *PorterInstanceController) updateStatusUnspecified(ctx context.Context) {
142143
instance, err := c.s.repo.FetchPorterByAddress(ctx, c.address)
143-
if data.ErrorIsNotFound(err) {
144+
if data.ErrorIsNotFound(err) { //nolint:nestif // no need
144145
id, err1 := c.s.id.New()
145146
if err1 != nil {
146147
c.heartbeatCount = min(-1, c.heartbeatCount-1)
@@ -149,6 +150,10 @@ func (c *PorterInstanceController) updateStatusUnspecified(ctx context.Context)
149150
c.ID = id
150151
c.Address = c.address
151152
c.Status = model.UserStatusBlocked
153+
if addr, err3 := url.Parse(c.address); err3 == nil && addr.Scheme == "inproc" {
154+
// Enable inproc instance by default
155+
c.Status = model.UserStatusActive
156+
}
152157
c.ConnectionStatusMessage = "First Initialization"
153158
_, err2 := c.s.repo.UpsertPorter(ctx, &c.PorterInstance)
154159
if err2 != nil {

0 commit comments

Comments
 (0)