mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Adding retry to all web calls. Hopefully I don't regret this.
This commit is contained in:
parent
ec066f54e9
commit
98c5ee9c57
2 changed files with 9 additions and 2 deletions
|
@ -525,7 +525,7 @@ def load_single_feed(request, feed_id):
|
|||
include_hidden = is_true(request.REQUEST.get('include_hidden', False))
|
||||
message = None
|
||||
user_search = None
|
||||
|
||||
|
||||
dupe_feed_id = None
|
||||
user_profiles = []
|
||||
now = localtime_for_timezone(datetime.datetime.now(), user.profile.timezone)
|
||||
|
|
|
@ -53,7 +53,8 @@ NEWSBLUR.AssetModel = Backbone.Router.extend({
|
|||
'traditional': true,
|
||||
'domSuccessTrigger': true,
|
||||
'preventDoubleRequests': false,
|
||||
'timeout': 15000
|
||||
'timeout': 15000,
|
||||
'retry': true
|
||||
}, options);
|
||||
var request_type = options.request_type || 'POST';
|
||||
var clear_queue = false;
|
||||
|
@ -104,6 +105,12 @@ NEWSBLUR.AssetModel = Backbone.Router.extend({
|
|||
NEWSBLUR.log(['AJAX Error', e, e.status, textStatus, errorThrown,
|
||||
!!error_callback, error_callback, $.isFunction(callback)]);
|
||||
|
||||
if (options.retry) {
|
||||
NEWSBLUR.log(['Retrying...', url, data, !!callback, !!error_callback, options]);
|
||||
options.retry = false;
|
||||
self.make_request(url, data, callback, error_callback, options);
|
||||
return;
|
||||
}
|
||||
if (errorThrown == "timeout") textStatus = "NewsBlur timed out trying<br />to connect. Just try again.";
|
||||
if (error_callback) {
|
||||
error_callback(e, textStatus, errorThrown);
|
||||
|
|
Loading…
Add table
Reference in a new issue