refactor(inputloader): better docs and naming (#265)

* refactor(inputloader): better docs and naming

Work done as part of https://github.com/ooni/probe/issues/1299.

* fix: correct a typo
This commit is contained in:
Simone Basso
2021-03-26 09:34:27 +01:00
committed by GitHub
parent c94721d9e5
commit 0115d6c470
9 changed files with 59 additions and 35 deletions
+2 -2
View File
@@ -176,7 +176,7 @@ func (r *Runner) Run(ctx context.Context) {
builder.SetCallbacks(&runnerCallbacks{emitter: r.emitter})
if len(r.settings.Inputs) <= 0 {
switch builder.InputPolicy() {
case engine.InputOrQueryTestLists, engine.InputStrictlyRequired:
case engine.InputOrQueryBackend, engine.InputStrictlyRequired:
r.emitter.EmitFailureStartup("no input provided")
return
}
@@ -209,7 +209,7 @@ func (r *Runner) Run(ctx context.Context) {
// this policy in the future, but for now this covers in a
// reasonable way web connectivity, so we should be ok.
switch builder.InputPolicy() {
case engine.InputOrQueryTestLists, engine.InputStrictlyRequired:
case engine.InputOrQueryBackend, engine.InputStrictlyRequired:
var cancel context.CancelFunc
ctx, cancel = context.WithTimeout(
ctx, time.Duration(r.settings.Options.MaxRuntime)*time.Second,