|
|
@@ -316,8 +316,23 @@ open class SchedulerService( |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private fun markDo1CatchUpDone(dDate: LocalDate) { |
|
|
private fun markDo1CatchUpDone(dDate: LocalDate) { |
|
|
val updated = (getDo1CatchUpDoneDDateSet() + dDate.toString()).sorted() |
|
|
|
|
|
settingsService.update(SettingNames.SCHEDULE_M18_DO1_CATCHUP_DONE_DDATE, updated.joinToString(",")) |
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
val name = SettingNames.SCHEDULE_M18_DO1_CATCHUP_DONE_DDATE |
|
|
|
|
|
val updated = (getDo1CatchUpDoneDDateSet() + dDate.toString()).sorted().joinToString(",") |
|
|
|
|
|
val existing = settingsService.findByName(name).orElse(null) |
|
|
|
|
|
if (existing != null) { |
|
|
|
|
|
settingsService.update(name, updated) |
|
|
|
|
|
} else { |
|
|
|
|
|
val setting = Settings() |
|
|
|
|
|
setting.name = name |
|
|
|
|
|
setting.value = updated |
|
|
|
|
|
setting.category = "SCHEDULE" |
|
|
|
|
|
setting.type = Settings.TYPE_STRING |
|
|
|
|
|
settingsService.save(setting) |
|
|
|
|
|
} |
|
|
|
|
|
} catch (e: Exception) { |
|
|
|
|
|
logger.error("Failed to persist DO1 catch-up done marker for dDate={}: {}", dDate, e.message, e) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
open fun runDo1CatchUp(dDate: LocalDate, skipExistingDo: Boolean = true) { |
|
|
open fun runDo1CatchUp(dDate: LocalDate, skipExistingDo: Boolean = true) { |
|
|
@@ -334,11 +349,12 @@ open class SchedulerService( |
|
|
} |
|
|
} |
|
|
try { |
|
|
try { |
|
|
getM18Dos1ForDDate(dDate, syncType = "DO1_CATCHUP", skipExistingDo = skipExistingDo) |
|
|
getM18Dos1ForDDate(dDate, syncType = "DO1_CATCHUP", skipExistingDo = skipExistingDo) |
|
|
markDo1CatchUpDone(dDate) |
|
|
|
|
|
logger.info("DO1 catch-up completed for dDate={}", dDate) |
|
|
|
|
|
} catch (e: Exception) { |
|
|
} catch (e: Exception) { |
|
|
logger.error("DO1 catch-up failed for dDate={}: {}", dDate, e.message, e) |
|
|
|
|
|
|
|
|
logger.error("DO1 catch-up sync failed for dDate={}: {}", dDate, e.message, e) |
|
|
|
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
markDo1CatchUpDone(dDate) |
|
|
|
|
|
logger.info("DO1 catch-up completed for dDate={}", dDate) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Scheduler |
|
|
// Scheduler |
|
|
|