Disable solr if not enough memory

This commit is contained in:
Girish Ramakrishnan
2020-12-02 17:33:54 -08:00
parent 7269e2c64f
commit cf620ee355
3 changed files with 15 additions and 7 deletions

View File

@@ -216,19 +216,22 @@ angular.module('Application').controller('EmailsController', ['$scope', '$locati
$scope.solrConfig = {
busy: false,
error: {},
currentConfig: {},
currentConfig: null, // null means not loaded yet
enabled: false,
running: false,
enoughMemory: false,
refresh: function () {
Client.getService('mail', function (error, result) {
if (error) return console.log('Error getting status of mail conatiner', error);
$scope.solrConfig.enoughMemory = result.config.memorySwap > (1024*1024*1024*2);
$scope.solrConfig.running = result.healthcheck && result.healthcheck.solr.status;
Client.getSolrConfig(function (error, config) {
if (error) return console.error('Failed to get solr config', error);
$scope.solrConfig.currentConfig = config;
$scope.solrConfig.running = result.healthcheck && result.healthcheck.solr.status;
});
});
},