Update async tasks

Remove overload memory usage low level timer
This commit is contained in:
salmanoe 2022-10-09 17:21:57 +07:00
parent b38ede0306
commit 215416cecb
4 changed files with 53 additions and 53 deletions

View File

@ -26,25 +26,25 @@ public class AutoKontrakVerification extends LocaleController<LogbookKinerjaVO>
private SettingDataFixedDao settingDataFixedDao; private SettingDataFixedDao settingDataFixedDao;
public AutoKontrakVerification() { public AutoKontrakVerification() {
int day = 21; // int day = 21;
int hour = 0; // int hour = 0;
int minute = 00; // int minute = 00;
KontrakVerificationTimer.schedule(new Runnable() { // KontrakVerificationTimer.schedule(new Runnable() {
@Override // @Override
public void run() { // public void run() {
try { // try {
LOGGER.info("Task Kontrak Verification : Running Task Kontrak Verification"); // LOGGER.info("Task Kontrak Verification : Running Task Kontrak Verification");
autoKontrakVerification(); // autoKontrakVerification();
} catch (Exception ex) { // } catch (Exception ex) {
LOGGER.error("Task Kontrak Verification : Task Kontrak Verification " + ex.getMessage()); // LOGGER.error("Task Kontrak Verification : Task Kontrak Verification " + ex.getMessage());
} finally { // } finally {
LOGGER.info("Task Kontrak Verification : Finishing Task Kontrak Verification"); // LOGGER.info("Task Kontrak Verification : Finishing Task Kontrak Verification");
} // }
} // }
}, day, hour, minute); // }, day, hour, minute);
} }
@Async // @Async
public void autoKontrakVerification() { public void autoKontrakVerification() {
try { try {
if (CommonUtil.isNotNullOrEmpty(logbookKinerjaService)) { if (CommonUtil.isNotNullOrEmpty(logbookKinerjaService)) {

View File

@ -22,25 +22,25 @@ public class AutoLogbookVerification extends LocaleController<LogbookKinerjaVO>
private LogbookKinerjaService logbookKinerjaService; private LogbookKinerjaService logbookKinerjaService;
public AutoLogbookVerification() { public AutoLogbookVerification() {
int day = 5; // int day = 5;
int hour = 0; // int hour = 0;
int minute = 00; // int minute = 00;
LogbookVerificationTimer.schedule(new Runnable() { // LogbookVerificationTimer.schedule(new Runnable() {
@Override // @Override
public void run() { // public void run() {
try { // try {
LOGGER.info("Task Logbook Verification : Running Task Logbook Verification"); // LOGGER.info("Task Logbook Verification : Running Task Logbook Verification");
autoLogbookVerification(); // autoLogbookVerification();
} catch (Exception ex) { // } catch (Exception ex) {
LOGGER.error("Task Logbook Verification : Task Logbook Verification " + ex.getMessage()); // LOGGER.error("Task Logbook Verification : Task Logbook Verification " + ex.getMessage());
} finally { // } finally {
LOGGER.info("Task Logbook Verification : Finishing Task Logbook Verification"); // LOGGER.info("Task Logbook Verification : Finishing Task Logbook Verification");
} // }
} // }
}, day, hour, minute); // }, day, hour, minute);
} }
@Async // @Async
public void autoLogbookVerification() { public void autoLogbookVerification() {
try { try {
if (CommonUtil.isNotNullOrEmpty(logbookKinerjaService)) { if (CommonUtil.isNotNullOrEmpty(logbookKinerjaService)) {

View File

@ -26,7 +26,7 @@ public class TargetLayananGenerating extends LocaleController<TargetLayananVO> {
* Disabled following update business rules * Disabled following update business rules
* @since 2022/08/28 * @since 2022/08/28
*/ */
// public TargetLayananGenerating() { public TargetLayananGenerating() {
// int day = 4; // int day = 4;
// int hour = 0; // int hour = 0;
// int minute = 00; // int minute = 00;
@ -43,9 +43,9 @@ public class TargetLayananGenerating extends LocaleController<TargetLayananVO> {
// } // }
// } // }
// }, day, hour, minute); // }, day, hour, minute);
// } }
@Async // @Async
public void genTargetLayanan() { public void genTargetLayanan() {
// Jam Kerja // Jam Kerja
try { try {

View File

@ -26,24 +26,24 @@ public class TargetSkorDokterGenerating extends LocaleController<TargetSkorDokte
private IkiDanRemunerasiService remunerasiService; private IkiDanRemunerasiService remunerasiService;
public TargetSkorDokterGenerating() { public TargetSkorDokterGenerating() {
int the1st = 1; // int the1st = 1;
int at0hrs = 0; // int at0hrs = 0;
TargetSkorDokterTimer.schedule(new Runnable() { // TargetSkorDokterTimer.schedule(new Runnable() {
@Override // @Override
public void run() { // public void run() {
try { // try {
LOGGER.info("Task Target Skor Dokter : Running Task Target Skor Dokter"); // LOGGER.info("Task Target Skor Dokter : Running Task Target Skor Dokter");
generateTargetSkorDokter(); // generateTargetSkorDokter();
} catch (Exception ex) { // } catch (Exception ex) {
LOGGER.error("Task Target Skor Dokter : Task Target Skor Dokter " + ex.getMessage()); // LOGGER.error("Task Target Skor Dokter : Task Target Skor Dokter " + ex.getMessage());
} finally { // } finally {
LOGGER.info("Task Target Skor Dokter : Finishing Target Skor Dokter"); // LOGGER.info("Task Target Skor Dokter : Finishing Target Skor Dokter");
} // }
} // }
}, the1st, at0hrs); // }, the1st, at0hrs);
} }
@Async // @Async
public void generateTargetSkorDokter() { public void generateTargetSkorDokter() {
try { try {
if (CommonUtil.isNotNullOrEmpty(remunerasiService)) { if (CommonUtil.isNotNullOrEmpty(remunerasiService)) {