Added a hook for fixing op type descriptions.
parent
966bfc881c
commit
cf9ed934d5
|
@ -31,12 +31,18 @@ type commonOp struct {
|
||||||
opsInFlight *sync.WaitGroup
|
opsInFlight *sync.WaitGroup
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func describeOpType(t reflect.Type) (desc string) {
|
||||||
|
// TODO(jacobsa): Make this nicer.
|
||||||
|
desc = t.String()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func (o *commonOp) init(
|
func (o *commonOp) init(
|
||||||
opType string,
|
opType reflect.Type,
|
||||||
r bazilfuse.Request,
|
r bazilfuse.Request,
|
||||||
log func(int, string, ...interface{}),
|
log func(int, string, ...interface{}),
|
||||||
opsInFlight *sync.WaitGroup) {
|
opsInFlight *sync.WaitGroup) {
|
||||||
o.opType = opType
|
o.opType = describeOpType(opType)
|
||||||
o.ctx = context.Background()
|
o.ctx = context.Background()
|
||||||
o.r = r
|
o.r = r
|
||||||
o.log = log
|
o.log = log
|
||||||
|
|
|
@ -213,7 +213,7 @@ func Convert(
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
co.init(reflect.TypeOf(o).String(), r, logForOp, opsInFlight)
|
co.init(reflect.TypeOf(o), r, logForOp, opsInFlight)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue