@@ -134,7 +134,7 @@ func (p *Process) getLastRequestHandled() time.Time {
134134 return p .lastRequestHandled
135135}
136136
137- // custom error types for swapping state
137+ // custom error types for swapping state.
138138var (
139139 ErrExpectedStateMismatch = errors .New ("expected state mismatch" )
140140 ErrInvalidStateTransition = errors .New ("invalid state transition" )
@@ -169,7 +169,7 @@ func (p *Process) swapState(expectedState, newState ProcessState) (ProcessState,
169169 return p .state , nil
170170}
171171
172- // Helper function to encapsulate transition rules
172+ // Helper function to encapsulate transition rules.
173173func isValidTransition (from , to ProcessState ) bool {
174174 switch from {
175175 case StateStopped :
@@ -260,7 +260,6 @@ func (p *Process) start() error {
260260 p .proxyLogger .Infof ("<%s> CMD: %v" , p .ID , args )
261261 p .proxyLogger .Infof ("<%s> ----------------------------------------" , p .ID )
262262 err = p .cmd .Start ()
263-
264263 // Set process state to failed
265264 if err != nil {
266265 if curState , swapErr := p .swapState (StateStarting , StateStopped ); swapErr != nil {
@@ -563,7 +562,7 @@ func (p *Process) ProxyRequest(w http.ResponseWriter, r *http.Request) {
563562 p .ID , r .RequestURI , startDuration , totalTime )
564563}
565564
566- // waitForCmd waits for the command to exit and handles exit conditions depending on current state
565+ // waitForCmd waits for the command to exit and handles exit conditions depending on current state.
567566func (p * Process ) waitForCmd () {
568567 exitErr := p .cmd .Wait ()
569568 p .proxyLogger .Debugf ("<%s> cmd.Wait() returned error: %v" , p .ID , exitErr )
@@ -607,7 +606,7 @@ func (p *Process) waitForCmd() {
607606 p .cmdMutex .Unlock ()
608607}
609608
610- // cmdStopUpstreamProcess attempts to stop the upstream process gracefully
609+ // cmdStopUpstreamProcess attempts to stop the upstream process gracefully.
611610func (p * Process ) cmdStopUpstreamProcess () error {
612611 p .processLogger .Debugf ("<%s> cmdStopUpstreamProcess() initiating graceful stop of upstream process" , p .ID )
613612
@@ -740,7 +739,7 @@ func newStatusResponseWriter(p *Process, w http.ResponseWriter) *statusResponseW
740739 return s
741740}
742741
743- // statusUpdates sends status updates to the client while the model is loading
742+ // statusUpdates sends status updates to the client while the model is loading.
744743func (s * statusResponseWriter ) statusUpdates (ctx context.Context ) {
745744 s .wg .Add (1 )
746745 defer s .wg .Done ()
@@ -798,7 +797,7 @@ func (s *statusResponseWriter) statusUpdates(ctx context.Context) {
798797 }
799798}
800799
801- // waitForCompletion waits for the statusUpdates goroutine to finish
800+ // waitForCompletion waits for the statusUpdates goroutine to finish.
802801func (s * statusResponseWriter ) waitForCompletion (timeout time.Duration ) bool {
803802 done := make (chan struct {})
804803 go func () {
0 commit comments