fix(server): remove unused Instance state field

Ayman Bagabas created

Change summary

internal/server/proto.go  | 11 +++++------
internal/server/server.go | 23 +++++------------------
2 files changed, 10 insertions(+), 24 deletions(-)

Detailed changes

internal/server/proto.go 🔗

@@ -595,12 +595,11 @@ func (c *controllerV1) handlePostInstances(w http.ResponseWriter, r *http.Reques
 	}
 
 	ins := &Instance{
-		App:   appInstance,
-		State: InstanceStateCreated,
-		id:    id,
-		path:  args.Path,
-		cfg:   cfg,
-		env:   args.Env,
+		App:  appInstance,
+		id:   id,
+		path: args.Path,
+		cfg:  cfg,
+		env:  args.Env,
 	}
 
 	c.instances.Set(id, ins)

internal/server/server.go 🔗

@@ -19,28 +19,15 @@ import (
 // ErrServerClosed is returned when the server is closed.
 var ErrServerClosed = http.ErrServerClosed
 
-// InstanceState represents the state of a running [app.App] instance.
-type InstanceState uint8
-
-const (
-	// InstanceStateCreated indicates that the instance has been created but not yet started.
-	InstanceStateCreated InstanceState = iota
-	// InstanceStateStarted indicates that the instance is currently running.
-	InstanceStateStarted
-	// InstanceStateStopped indicates that the instance has been stopped.
-	InstanceStateStopped
-)
-
 // Instance represents a running [app.App] instance with its associated
 // resources and state.
 type Instance struct {
 	*app.App
-	State InstanceState
-	ln    net.Listener
-	cfg   *config.Config
-	id    string
-	path  string
-	env   []string
+	ln   net.Listener
+	cfg  *config.Config
+	id   string
+	path string
+	env  []string
 }
 
 // ParseHostURL parses a host URL into a [url.URL].