reports-service завершение работы сразу (доделать для сервиса, пока из консоли выключится сразу)

This commit is contained in:
AKurakin 2022-12-26 20:31:40 +03:00
parent 363a809afc
commit 960d0e6b68

View file

@ -36,6 +36,8 @@ public class ReportsServiceApplication {
LocalDate date1 = LocalDate.of(date2.getYear(), date2.getMonth(), 1);//date2.minusMonths(1);
xmlReportBuilder.createReport(date1, date2);
}
log.info("Shutdown application after work");
context.close(); // todo если будет запущен как сервис, сделать выход опционально, по другому.
} catch (Throwable e) {
LoggerFactory.getLogger(ReportsServiceApplication.class).error("Report-service start failed: {} -> {}", e.getClass().getSimpleName(), ExceptionUtils.getStackTrace(e));
System.exit(-1);