You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_, err=db.WriterDb.Exec(`UPDATE users_val_dashboards_groups SET webhook_retries = 0 WHERE id = $1 AND dashboard_id = $2;`, dashboardGroupId, dashboardId)
841
-
iferr!=nil {
842
-
log.Error(err, "error updating users_webhooks table; setting retries to zero", 0)
843
-
continue
844
-
}
845
-
} elseifw.Retries>5&&!w.LastSent.Valid {
846
-
log.Warnf("webhook '%v' for dashboard %d and group %d has more than 5 retries and does not have a valid last_sent timestamp", w.Url, dashboardId, dashboardGroupId)
847
-
continue
848
-
}
849
-
850
837
ifw.Retries>=5 {
851
-
// early return
838
+
if!w.LastSent.Valid {
839
+
log.Warnf("webhook '%v' for dashboard %d and group %d has more than 5 retries and does not have a valid last_sent timestamp", w.Url, dashboardId, dashboardGroupId)
_, err=db.WriterDb.Exec(`UPDATE users_val_dashboards_groups SET webhook_retries = 0 WHERE id = $1 AND dashboard_id = $2;`, dashboardGroupId, dashboardId)
842
+
iferr!=nil {
843
+
log.Error(err, "error updating users_webhooks table; setting retries to zero", 0)
844
+
} else {
845
+
log.Infof("webhook '%v' for dashboard %d and group %d has 5 retries and has been reset", w.Url, dashboardId, dashboardGroupId)
0 commit comments