mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Independent technology for modern publishing, memberships, subscriptions and newsletters.
bloggingcmscreator-economyghosthacktoberfestheadless-cmsjamstackjavascriptjournalismnodejspublishingweb-application
closes https://github.com/TryGhost/Team/issues/837 We previously added automatic retries to the editor controller for post saves; reviewing the resulting logs in Sentry we can see this stopped the "Server unreachable" error alerts showing to users because the requests typically succeeded on the first retry that was made 5 seconds later. However the problem is not limited to post saves and we can see other requests hitting the same issue, including when working in the editor such as adding embed cards, uploading images, or fetching member counts before publishing. All of the API network requests we make in Admin run through an `ajax` service that makes and handles the request/response. By moving the retry logic for specific errors out of the editor controller and into the ajax service we can make temporary connection handling more graceful across the app. - move retry behaviour from the editor controller to the `ajax` service so we can retry any request rather than just post save requests - speed up retries so we reconnect as soon as possible - first retry at 500ms, then every 1000ms (previous was every 5s which meant overly long waits) - reduce total retry time from >30s to 15s - improve reporting to Sentry - report when a retry was required - report when a retry failed - include the total time taken for both success and failure reports - include the `server` header value from requests to distinguish between CDNs - include type of error so we can distinguish "server unreachable" from "maintenance" retries |
||
---|---|---|
ghost/admin |