sched: Address review
This commit is contained in:
parent
5a458a60c2
commit
1597e85906
@ -67,6 +67,7 @@ func (a *AssignerCommon) TrySched(sh *Scheduler) {
|
|||||||
|
|
||||||
partDone := metrics.Timer(sh.mctx, metrics.SchedAssignerCandidatesDuration)
|
partDone := metrics.Timer(sh.mctx, metrics.SchedAssignerCandidatesDuration)
|
||||||
defer func() {
|
defer func() {
|
||||||
|
// call latest value of partDone in case we error out somewhere
|
||||||
partDone()
|
partDone()
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -589,12 +589,16 @@ func TestSched(t *testing.T) {
|
|||||||
type slowishSelector bool
|
type slowishSelector bool
|
||||||
|
|
||||||
func (s slowishSelector) Ok(ctx context.Context, task sealtasks.TaskType, spt abi.RegisteredSealProof, a SchedWorker) (bool, bool, error) {
|
func (s slowishSelector) Ok(ctx context.Context, task sealtasks.TaskType, spt abi.RegisteredSealProof, a SchedWorker) (bool, bool, error) {
|
||||||
|
// note: we don't care about output here, just the time those calls take
|
||||||
|
// (selector Ok/Cmp is called in the scheduler)
|
||||||
_, _ = a.Paths(ctx)
|
_, _ = a.Paths(ctx)
|
||||||
_, _ = a.TaskTypes(ctx)
|
_, _ = a.TaskTypes(ctx)
|
||||||
return bool(s), false, nil
|
return bool(s), false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s slowishSelector) Cmp(ctx context.Context, task sealtasks.TaskType, a, b SchedWorker) (bool, error) {
|
func (s slowishSelector) Cmp(ctx context.Context, task sealtasks.TaskType, a, b SchedWorker) (bool, error) {
|
||||||
|
// note: we don't care about output here, just the time those calls take
|
||||||
|
// (selector Ok/Cmp is called in the scheduler)
|
||||||
_, _ = a.Paths(ctx)
|
_, _ = a.Paths(ctx)
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user