use of org.hisp.dhis.dataintegrity.tasks.DataIntegrityTask in project dhis2-core by dhis2.
the class DataIntegrityController method runAsyncDataIntegrity.
//--------------------------------------------------------------------------
// Start asynchronous data integrity task
//--------------------------------------------------------------------------
@PreAuthorize("hasRole('ALL') or hasRole('F_PERFORM_MAINTENANCE')")
@RequestMapping(value = DataIntegrityController.RESOURCE_PATH, method = RequestMethod.POST)
public void runAsyncDataIntegrity(HttpServletResponse response, HttpServletRequest request) {
TaskId taskId = new TaskId(TaskCategory.DATAINTEGRITY, currentUserService.getCurrentUser());
notifier.clear(taskId);
scheduler.executeTask(new DataIntegrityTask(taskId, dataIntegrityService, notifier));
response.setHeader("Location", ContextUtils.getRootPath(request) + "/system/tasks/" + TaskCategory.DATAINTEGRITY);
response.setStatus(HttpServletResponse.SC_ACCEPTED);
}
Aggregations