From 5f5c995425de8dfad3d072dafd74f0bb5d2b32f6 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Thu, 25 Sep 2025 16:36:36 -0400 Subject: [PATCH] fix(server): remove unused Instance state field --- internal/server/proto.go | 11 +++++------ internal/server/server.go | 23 +++++------------------ 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/internal/server/proto.go b/internal/server/proto.go index 5caa59a47a6116c2a3223b206c04879a8e1f59aa..da4c2a9d8a7b8c145c8183333cc644512a37a6de 100644 --- a/internal/server/proto.go +++ b/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) diff --git a/internal/server/server.go b/internal/server/server.go index ce136573e8411ea485aed885f6c9de6c6e36181f..0c243fe10d990e62e7d8101c38e948fa50c1b2bd 100644 --- a/internal/server/server.go +++ b/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].