Closes #219: button to force full reindexing

This commit is contained in:
Benjamin Gamard 2018-10-29 19:01:32 +01:00
parent 35c3ee023b
commit eb9e0e0543
5 changed files with 25 additions and 2 deletions

View File

@ -63,5 +63,9 @@ public class RebuildIndexAsyncListener {
offset += 100; offset += 100;
} while (fileList.size() > 0); } while (fileList.size() > 0);
}); });
if (log.isInfoEnabled()) {
log.info("Rebuilding index done");
}
} }
} }

View File

@ -190,7 +190,7 @@ public class AppContext {
public int getQueuedTaskCount() { public int getQueuedTaskCount() {
int queueSize = 0; int queueSize = 0;
for (ThreadPoolExecutor executor : asyncExecutorList) { for (ThreadPoolExecutor executor : asyncExecutorList) {
queueSize += executor.getQueue().size(); queueSize += executor.getTaskCount() - executor.getCompletedTaskCount();
} }
return queueSize; return queueSize;
} }

View File

@ -13,4 +13,11 @@ angular.module('docs').controller('SettingsMonitoring', function($scope, Restang
}).then(function(data) { }).then(function(data) {
$scope.logs = data.logs; $scope.logs = data.logs;
}); });
$scope.reindexingStarted = false;
$scope.startReindexing = function() {
Restangular.one('app').post('batch/reindex').then(function () {
$scope.reindexingStarted = true;
});
};
}); });

View File

@ -411,7 +411,11 @@
"server_logs": "Server logs", "server_logs": "Server logs",
"log_date": "Date", "log_date": "Date",
"log_tag": "Tag", "log_tag": "Tag",
"log_message": "Message" "log_message": "Message",
"indexing": "Indexing",
"indexing_info": "If you notice discrepancies in the search results, you can try to do a full reindexing. Search results will be incomplete until this operation is done.",
"start_reindexing": "Start full reindexing",
"reindexing_started": "Re-indexing started, please wait until there is no more background tasks."
}, },
"session": { "session": {
"title": "Opened sessions", "title": "Opened sessions",

View File

@ -5,6 +5,14 @@
<span class="fas fa-circle-notch text-warning fa-spin" ng-if="app.queued_tasks > 0"></span> <span class="fas fa-circle-notch text-warning fa-spin" ng-if="app.queued_tasks > 0"></span>
</p> </p>
<p>{{ 'settings.monitoring.queued_tasks_explain' | translate }}</p> <p>{{ 'settings.monitoring.queued_tasks_explain' | translate }}</p>
<h2 translate="settings.monitoring.indexing"></h2>
{{ 'settings.monitoring.indexing_info' | translate }}
<div class="mt-10">
<button class="btn btn-danger" ng-click="startReindexing()" ng-show="!reindexingStarted">{{ 'settings.monitoring.start_reindexing' | translate }}</button>
<span class="text-danger" ng-show="reindexingStarted"><strong>{{ 'settings.monitoring.reindexing_started' | translate }}</strong></span>
</div>
<h2 translate="settings.monitoring.server_logs"></h2> <h2 translate="settings.monitoring.server_logs"></h2>
<table class="table table-hover table-logs"> <table class="table table-hover table-logs">
<thead> <thead>