Handle memory limit errors
This commit is contained in:
@@ -754,7 +754,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-right">
|
||||
<div class="col-md-8">
|
||||
<span ng-show="resources.error.memoryLimit" class="text-danger">Unable to set memory limit, try less.</span>
|
||||
</div>
|
||||
<div class="col-md-4 text-right">
|
||||
<button class="btn btn-outline btn-primary pull-right" ng-click="resources.submitMemoryLimit()" ng-disabled="resources.memoryLimit === resources.currentMemoryLimit || resourcesForm.$invalid || resources.busy || app.error || app.taskId" tooltip-enable="app.error || app.taskId" uib-tooltip="{{ app.error ? 'App is in error state' : 'App is busy' }}">
|
||||
<i class="fa fa-circle-notch fa-spin" ng-show="resources.busy"></i> Resize
|
||||
</button>
|
||||
|
||||
@@ -501,6 +501,11 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
|
||||
var memoryLimit = $scope.resources.memoryLimit === $scope.resources.memoryTicks[0] ? 0 : $scope.resources.memoryLimit;
|
||||
Client.configureApp($scope.app.id, 'memory_limit', { memoryLimit: memoryLimit }, function (error) {
|
||||
if (error && error.statusCode === 400) {
|
||||
$scope.resources.busy = false;
|
||||
$scope.resources.error.memoryLimit = true;
|
||||
return;
|
||||
}
|
||||
if (error) return Client.error(error);
|
||||
|
||||
$scope.resources.currentMemoryLimit = $scope.resources.memoryLimit;
|
||||
|
||||
Reference in New Issue
Block a user