use of com.enonic.xp.app.system.listener.VacuumListenerImpl in project xp by enonic.
the class VacuumTaskHandler method execute.
public void execute() {
final ProgressReporter progressReporter = TaskProgressReporterContext.current();
final VacuumResult result = vacuumService.vacuum(VacuumParameters.create().ageThreshold(ageThreshold != null ? Duration.parse(ageThreshold) : null).taskNames(tasks == null || tasks.isEmpty() ? DEFAULT_VACUUM_TASKS : tasks).vacuumListener(new VacuumListenerImpl(progressReporter)).build());
try {
progressReporter.info(MAPPER.writeValueAsString(MAPPER.createObjectNode().putPOJO("taskResults", result.getResults())));
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
}
Aggregations