MCPcopy Create free account
hub / github.com/dgraph-io/dgraph / isDebug

Function isDebug

query/query.go:779–795  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

777)
778
779func isDebug(ctx context.Context) bool {
780 var debug bool
781
782 // gRPC client passes information about debug as metadata.
783 if md, ok := metadata.FromIncomingContext(ctx); ok {
784 // md is a map[string][]string
785 if len(md["debug"]) > 0 {
786 // We ignore the error here, because in error case,
787 // debug would be false which is what we want.
788 debug, _ = strconv.ParseBool(md["debug"][0])
789 }
790 }
791
792 // HTTP passes information about debug as query parameter which is attached to context.
793 d, _ := ctx.Value(DebugKey).(bool)
794 return debug || d
795}
796
797func (sg *SubGraph) populate(uids []uint64) error {
798 // Put sorted entries in matrix.

Callers 1

newGraphFunction · 0.85

Calls 1

ValueMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…