Workaround to keep track of upload state
This commit is contained in:
parent
4f6c8aa18b
commit
4738f7f32d
|
@ -181,7 +181,6 @@ func (c *Controller) Init(nt *mk.Nettest) error {
|
||||||
if c.inputIdxMap != nil {
|
if c.inputIdxMap != nil {
|
||||||
urlID = sql.NullInt64{Int64: c.inputIdxMap[idx], Valid: true}
|
urlID = sql.NullInt64{Int64: c.inputIdxMap[idx], Valid: true}
|
||||||
}
|
}
|
||||||
log.Debugf("👁 %d %s %d", idx, e.Value.Input, urlID.Int64)
|
|
||||||
msmt, err := database.CreateMeasurement(c.Ctx.DB, reportID, testName, resultID, reportFilePath, urlID)
|
msmt, err := database.CreateMeasurement(c.Ctx.DB, reportID, testName, resultID, reportFilePath, urlID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithError(err).Error("Failed to create measurement")
|
log.WithError(err).Error("Failed to create measurement")
|
||||||
|
@ -250,9 +249,12 @@ func (c *Controller) Init(nt *mk.Nettest) error {
|
||||||
nt.On("status.measurement_submission", func(e mk.Event) {
|
nt.On("status.measurement_submission", func(e mk.Event) {
|
||||||
log.Debugf(color.RedString(e.Key))
|
log.Debugf(color.RedString(e.Key))
|
||||||
|
|
||||||
|
// XXX maybe this should change once MK is aligned with the spec
|
||||||
|
if c.Ctx.Config.Sharing.UploadResults == true {
|
||||||
if err := c.msmts[e.Value.Idx].UploadSucceeded(c.Ctx.DB); err != nil {
|
if err := c.msmts[e.Value.Idx].UploadSucceeded(c.Ctx.DB); err != nil {
|
||||||
log.WithError(err).Error("failed to mark msmt as uploaded")
|
log.WithError(err).Error("failed to mark msmt as uploaded")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
nt.On("status.measurement_done", func(e mk.Event) {
|
nt.On("status.measurement_done", func(e mk.Event) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user