MCPcopy Index your code
hub / github.com/github/github-mcp-server / wait

Method wait

internal/oauth/callback.go:126–134  ·  view source on GitHub ↗

wait blocks for the callback outcome or ctx cancellation, then shuts the server down. It is safe to call once per server.

(ctx context.Context)

Source from the content-addressed store, hash-verified

124// wait blocks for the callback outcome or ctx cancellation, then shuts the
125// server down. It is safe to call once per server.
126func (cs *callbackServer) wait(ctx context.Context) (string, error) {
127 defer cs.close()
128 select {
129 case res := <-cs.results:
130 return res.code, res.err
131 case <-ctx.Done():
132 return "", ctx.Err()
133 }
134}
135
136func (cs *callbackServer) close() {
137 shutdownCtx, cancel := context.WithTimeout(context.Background(), 2*time.Second)

Callers 1

beginPKCEMethod · 0.80

Calls 1

closeMethod · 0.95

Tested by

no test coverage detected