Skip to content

Commit

Permalink
miniooni: submit and save also if measurement returns error (#324)
Browse files Browse the repository at this point in the history
See #316
  • Loading branch information
bassosimone authored Feb 10, 2020
1 parent c08921f commit 3593020
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/miniooni/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,14 +314,16 @@ func main() {
measurement, err := experiment.Measure(input)
if err != nil {
log.WithError(err).Warn("measurement failed")
continue
// fallthrough and try to submit what we have anyway. Even if it
// has failed badly, we'd rather see it.
}
measurement.AddAnnotations(annotations)
if !globalOptions.noCollector {
log.Infof("submitting measurement to OONI collector")
if err := experiment.SubmitAndUpdateMeasurement(measurement); err != nil {
log.WithError(err).Warn("submitting measurement failed")
continue
// fallthrough and save to disk what we have. Not saving is
// worst because it means we cannot eventually resubmit.
}
}
if !globalOptions.noJSON {
Expand All @@ -332,7 +334,7 @@ func main() {
measurement, globalOptions.reportfile,
); err != nil {
log.WithError(err).Warn("saving measurement failed")
continue
// fallthrough because we're at the bottom of the loop
}
}
}
Expand Down

0 comments on commit 3593020

Please sign in to comment.