fix: disable maxRuntime when not WebConnectivity
See https://github.com/ooni/probe/issues/1433
This commit is contained in:
parent
51459e23b2
commit
6306c09963
|
@ -120,6 +120,11 @@ func (c *Controller) Run(builder *engine.ExperimentBuilder, inputs []string) err
|
||||||
log.Debug("disabling maxRuntime when running in the background")
|
log.Debug("disabling maxRuntime when running in the background")
|
||||||
maxRuntime = 0
|
maxRuntime = 0
|
||||||
}
|
}
|
||||||
|
_, isWebConnectivity := c.nt.(WebConnectivity)
|
||||||
|
if !isWebConnectivity {
|
||||||
|
log.Debug("disabling maxRuntime without Web Connectivity")
|
||||||
|
maxRuntime = 0
|
||||||
|
}
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
c.ntStartTime = start
|
c.ntStartTime = start
|
||||||
for idx, input := range inputs {
|
for idx, input := range inputs {
|
||||||
|
@ -214,7 +219,8 @@ func (c *Controller) Run(builder *engine.ExperimentBuilder, inputs []string) err
|
||||||
func (c *Controller) OnProgress(perc float64, msg string) {
|
func (c *Controller) OnProgress(perc float64, msg string) {
|
||||||
// when we have maxRuntime, honor it
|
// when we have maxRuntime, honor it
|
||||||
maxRuntime := time.Duration(c.Probe.Config().Nettests.WebsitesMaxRuntime) * time.Second
|
maxRuntime := time.Duration(c.Probe.Config().Nettests.WebsitesMaxRuntime) * time.Second
|
||||||
if c.RunType == "manual" && maxRuntime > 0 {
|
_, isWebConnectivity := c.nt.(WebConnectivity)
|
||||||
|
if c.RunType == "manual" && maxRuntime > 0 && isWebConnectivity {
|
||||||
elapsed := time.Since(c.ntStartTime)
|
elapsed := time.Since(c.ntStartTime)
|
||||||
perc = float64(elapsed) / float64(maxRuntime)
|
perc = float64(elapsed) / float64(maxRuntime)
|
||||||
eta := maxRuntime.Seconds() - elapsed.Seconds()
|
eta := maxRuntime.Seconds() - elapsed.Seconds()
|
||||||
|
|
|
@ -3,5 +3,5 @@ package version
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// Version is the software version
|
// Version is the software version
|
||||||
Version = "3.9.0"
|
Version = "3.9.1"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user