summaryrefslogtreecommitdiff
path: root/app/javascript/controllers
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-06-06 12:22:30 -0400
committerDavid Gay <david@davidgay.org>2021-06-06 12:22:42 -0400
commitb477eb3f9b66cfc2794d56807928996f5a4e2362 (patch)
tree35d3558c057284a6d847b2eddcad8c8426c067f8 /app/javascript/controllers
parentd701cf456bba209f31387db6b43bf26b1251e188 (diff)
Tweak finish activity retry code to avoid flooding Honeybadger
Diffstat (limited to 'app/javascript/controllers')
-rw-r--r--app/javascript/controllers/timer_controller.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/javascript/controllers/timer_controller.js b/app/javascript/controllers/timer_controller.js
index dcf046a..4888f6a 100644
--- a/app/javascript/controllers/timer_controller.js
+++ b/app/javascript/controllers/timer_controller.js
@@ -43,12 +43,12 @@ export default class extends Controller {
success: () => {
this.postFailures = 0;
},
- error: () => {
+ error: (e, xhr) => {
this.postFailures++;
- if (this.postFailures < 5) {
- setTimeout(controller.finishActivity, 1000);
- } else {
- setTimeout(controller.finishActivity, 60000);
+ if (this.postFailures < 3) {
+ setTimeout(controller.finishActivity, 1000); // 1 second
+ } else if (xhr === "") {
+ setTimeout(controller.finishActivity, 60000); // 1 minute
}
},
});