MCPcopy Index your code
hub / github.com/coder/agentapi / Stop

Method Stop

lib/httpapi/server.go:629–644  ·  view source on GitHub ↗

Stop gracefully stops the HTTP server. It is safe to call multiple times.

(ctx context.Context)

Source from the content-addressed store, hash-verified

627
628// Stop gracefully stops the HTTP server. It is safe to call multiple times.
629func (s *Server) Stop(ctx context.Context) error {
630 var err error
631 s.stopOnce.Do(func() {
632 s.shutdown()
633
634 // Clean up temporary directory
635 s.cleanupTempDir()
636
637 if s.srv != nil {
638 if err = s.srv.Shutdown(ctx); errors.Is(err, http.ErrServerClosed) {
639 err = nil
640 }
641 }
642 })
643 return err
644}
645
646// cleanupTempDir removes the temporary directory and all its contents
647func (s *Server) cleanupTempDir() {

Callers 12

runServerFunction · 0.95
writeStabilizeMethod · 0.45
ReadScreenMethod · 0.45
CloseMethod · 0.45
WaitForFunction · 0.45
handleSignalsFunction · 0.45
handleSignalsFunction · 0.45
runAttachFunction · 0.45
waitForServerFunction · 0.45
waitForMessagesWithCountFunction · 0.45
runSpinnerFunction · 0.45

Calls 2

cleanupTempDirMethod · 0.95
DoMethod · 0.65

Tested by 3

waitForServerFunction · 0.36
waitForMessagesWithCountFunction · 0.36