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

Function handleSignals

cmd/server/signals_windows.go:15–24  ·  view source on GitHub ↗

handleSignals sets up signal handlers for Windows.

(ctx context.Context, cancel context.CancelFunc, logger *slog.Logger, srv *httpapi.Server)

Source from the content-addressed store, hash-verified

13
14// handleSignals sets up signal handlers for Windows.
15func handleSignals(ctx context.Context, cancel context.CancelFunc, logger *slog.Logger, srv *httpapi.Server) {
16 shutdownCh := make(chan os.Signal, 1)
17 signal.Notify(shutdownCh, os.Interrupt)
18 go func() {
19 defer signal.Stop(shutdownCh)
20 sig := <-shutdownCh
21 logger.Info("Received shutdown signal", "signal", sig)
22 cancel()
23 }()
24}

Callers

nothing calls this directly

Calls 1

StopMethod · 0.45

Tested by

no test coverage detected