File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
internal/biz/bizsupervisor Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 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.
141142func (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 {
You can’t perform that action at this time.
0 commit comments