mail relay: wait for mail container to restart

This commit is contained in:
Girish Ramakrishnan
2020-02-27 10:42:30 -08:00
parent e528cf5692
commit 3c7e28c768

View File

@@ -493,19 +493,25 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
}
Client.setMailRelay($scope.domain.domain, data, function (error) {
$scope.mailRelay.busy = false;
if (error) {
$scope.mailRelay.error = error.message;
$scope.mailRelay.busy = false;
return;
}
$scope.domain.relay = data;
$scope.mailRelay.success = true;
$scope.refreshDomain();
// clear success indicator after 3sec
$timeout(function () { $scope.mailRelay.success = false; }, 3000);
// let the mail server restart, otherwise we get "Error getting IP" errors during refresh
$timeout(function () {
$scope.mailRelay.busy = false;
$scope.mailRelay.success = true;
$scope.refreshDomain();
// clear success indicator after 5sec
$timeout(function () { $scope.mailRelay.success = false; }, 5000);
}, 5000);
});
}
};