MCPcopy
hub / github.com/wavetermdev/waveterm / termCtxWithLogBlockId

Function termCtxWithLogBlockId

pkg/wshrpc/wshserver/wshserver.go:583–596  ·  view source on GitHub ↗
(ctx context.Context, logBlockId string)

Source from the content-addressed store, hash-verified

581}
582
583func termCtxWithLogBlockId(ctx context.Context, logBlockId string) context.Context {
584 if logBlockId == "" {
585 return ctx
586 }
587 block, err := wstore.DBMustGet[*waveobj.Block](ctx, logBlockId)
588 if err != nil {
589 return ctx
590 }
591 connDebug := block.Meta.GetString(waveobj.MetaKey_TermConnDebug, "")
592 if connDebug == "" {
593 return ctx
594 }
595 return blocklogger.ContextWithLogBlockId(ctx, logBlockId, connDebug == "debug")
596}
597
598func (ws *WshServer) ConnEnsureCommand(ctx context.Context, data wshrpc.ConnExtData) error {
599 ctx = genconn.ContextWithConnData(ctx, data.LogBlockId)

Callers 4

ConnEnsureCommandMethod · 0.85
ConnConnectCommandMethod · 0.85

Calls 3

DBMustGetFunction · 0.92
ContextWithLogBlockIdFunction · 0.92
GetStringMethod · 0.80

Tested by

no test coverage detected