discourse/app
Sam 110e9a455b
FEATURE: when we fail to ship topic timings attempt to retry (#10916)
* FEATURE: when we fail to ship topic timings attempt to retry

This change amends it so

1. Topic timings are treated as background requests and subject to more
 aggressive rate limits.

2. If we notice an error when we ship timings we back off exponentially

The commit allows 405, 429, 500, 501, 502, 503 and 504 errors to be retried.

500+ errors usually happen when self hosters are rebuilding or some other
weird condition.

405 happens when site is in readonly.
429 happens when user is rate limited.

The retry cadence is hardcoded in AJAX_FAILURE_DELAYS, longest delay is
40 seconds, we may consider enlarging it.

After the last delay passes we give up and do not write timings to the
server.

* Address feedback

- Omit promise, no need to use promises in sendNextConsolidatedTiming
- Correct issue where >= -1 was used and > -1 was intended
- Use objects for consolidated timings instead of Array
- Stop using shift/unshift and instead use push / pop which are faster

* Move consolidated timing initialization to constructor

* Remove TODO and just console.warn if we have an issue
2020-10-16 09:49:55 +11:00
..
assets FEATURE: when we fail to ship topic timings attempt to retry (#10916) 2020-10-16 09:49:55 +11:00
controllers Tag groups can belong to groups (#10854) 2020-10-14 13:15:54 -04:00
helpers Replace base_uri with base_path (#10879) 2020-10-09 12:51:24 +01:00
jobs FEATURE: Add weekly bookmark cleanup code (#10899) 2020-10-14 09:38:57 +10:00
mailers FIX: When admin changes an email for the user the user must confirm the change (#10830) 2020-10-07 13:02:24 +10:00
models FEATURE: WCAG compliant color schemes (#10882) 2020-10-15 14:05:48 -04:00
serializers FIX: sort using ruby to avoid N+1 queries (#10915) 2020-10-14 18:20:41 +11:00
services REFACTOR: Removes double check of site setting in badge granter 2020-10-05 19:59:57 +02:00
views Revert "FEATURE: Upgrade analytics.js to gtag.js (#10893)" (#10910) 2020-10-13 12:20:41 -05:00