fix(ooniprobe): disable maxRuntime when in the background (#276)
Part of https://github.com/ooni/probe/issues/1299
This commit is contained in:
parent
991b0a6120
commit
4e344f1fcf
|
@ -116,11 +116,13 @@ func (c *Controller) Run(builder *engine.ExperimentBuilder, inputs []string) err
|
|||
}
|
||||
|
||||
maxRuntime := time.Duration(c.Probe.Config().Nettests.WebsitesMaxRuntime) * time.Second
|
||||
if c.RunType == "timed" && maxRuntime > 0 {
|
||||
log.Debug("disabling maxRuntime when running in the background")
|
||||
maxRuntime = 0
|
||||
}
|
||||
start := time.Now()
|
||||
c.ntStartTime = start
|
||||
for idx, input := range inputs {
|
||||
// TODO(bassosimone): should we allow for interruption when running
|
||||
// in unattended mode? Likewise, should we honor MaxRuntime?
|
||||
if c.Probe.IsTerminated() {
|
||||
log.Info("user requested us to terminate using Ctrl-C")
|
||||
break
|
||||
|
|
Loading…
Reference in New Issue
Block a user