Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sporadical timeout issue when adding new samples/remarks #1522

Merged
merged 2 commits into from
Feb 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Changelog

**Fixed**

- #1522 Fix sporadical timeout issue when adding new samples/remarks
- #1506 Changes via manage results don't get applied to partitions
- #1506 Fix recursion error when getting dependencies through Calculation
- #1506 setter from ARAnalysisField does no longer return values
Expand Down
8 changes: 7 additions & 1 deletion bika/lims/browser/js/bika.lims.analysisrequest.add.js
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,8 @@
cache: false,
dataType: 'json',
processData: false,
contentType: false
contentType: false,
timeout: 600000
};
$.extend(ajax_options, options);

Expand All @@ -1239,6 +1240,11 @@
$(me).trigger("ajax:start");
return $.ajax(ajax_options).always(function(data) {
return $(me).trigger("ajax:end");
}).fail(function(request, status, error) {
var msg;
msg = _("Sorry, an error occured: " + status);
window.bika.lims.portalMessage(msg);
return window.scroll(0, 0);
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,7 @@ class window.AnalysisRequestAdd
processData: false
contentType: false
# contentType: 'application/x-www-form-urlencoded; charset=UTF-8'
timeout: 600000 # 10 minutes timeout

# Update Options
$.extend(ajax_options, options)
Expand All @@ -1262,6 +1263,10 @@ class window.AnalysisRequestAdd
$.ajax(ajax_options).always (data) ->
# Always notify Ajax end
$(me).trigger "ajax:end"
.fail (request, status, error) ->
msg = _("Sorry, an error occured: #{status}")
window.bika.lims.portalMessage msg
window.scroll 0, 0


on_ajax_start: =>
Expand Down
5 changes: 5 additions & 0 deletions bika/lims/browser/js/coffee/bika_widgets/remarkswidget.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,15 @@ class window.RemarksWidgetView
url: @get_portal_url() + "/@@API/update"
data:
obj_uid: widget.attr('data-uid')
timeout: 600000 # 10 minutes timeout
options.data[fieldname] = value
@ajax_submit options
.done (data) ->
return deferred.resolveWith this, [[]]
.fail (request, status, error) ->
msg = _("Sorry, an error occured: #{status}")
window.bika.lims.portalMessage msg
window.scroll 0, 0
return deferred.promise()

### EVENT HANDLERS ###
Expand Down
8 changes: 7 additions & 1 deletion bika/lims/skins/bika/bika_widgets/remarkswidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,18 @@
options = {
url: this.get_portal_url() + "/@@API/update",
data: {
obj_uid: widget.attr('data-uid')
obj_uid: widget.attr('data-uid'),
timeout: 600000
}
};
options.data[fieldname] = value;
this.ajax_submit(options).done(function(data) {
return deferred.resolveWith(this, [[]]);
}).fail(function(request, status, error) {
var msg;
msg = _("Sorry, an error occured: " + status);
window.bika.lims.portalMessage(msg);
return window.scroll(0, 0);
});
return deferred.promise();
};
Expand Down