You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/09/22 01:57:13 UTC
[GitHub] [dolphinscheduler] ruanwenjun commented on a diff in pull request #12093: [Bug][Timezone][3.0.1] fix timezone when complement data and preview
ruanwenjun commented on code in PR #12093:
URL: https://github.com/apache/dolphinscheduler/pull/12093#discussion_r977116917
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java:
##########
@@ -759,9 +766,18 @@ protected int createComplementCommandList(Date start, Date end, RunMode runMode,
endDateIndex += singleCommandItems;
}
- cmdParam.put(CMDPARAM_COMPLEMENT_DATA_START_DATE, DateUtils.dateToString(listDate.get(startDateIndex)));
- cmdParam.put(CMDPARAM_COMPLEMENT_DATA_END_DATE, DateUtils.dateToString(listDate.get(endDateIndex)));
+ Date startDate = listDate.get(startDateIndex);
+ Date endDate = listDate.get(endDateIndex);
+
+ cmdParam.put(CMDPARAM_COMPLEMENT_DATA_START_DATE, DateUtils.dateToString(startDate, ZoneId.systemDefault().getId()));
+ cmdParam.put(CMDPARAM_COMPLEMENT_DATA_END_DATE, DateUtils.dateToString(endDate, ZoneId.systemDefault().getId()));
+ cmdParam.put(CMDPARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST, JSONUtils.toJsonString(CronUtils.getSelfFireDateList(startDate, endDate, schedules)));
command.setCommandParam(JSONUtils.toJsonString(cmdParam));
+
+ logger.info("before create complement command: startDate:{}, startStr:{}, endDate:{}, endStr:{}, complement date list: {}",
+ listDate.get(startDateIndex), DateUtils.dateToString(listDate.get(startDateIndex), ZoneId.systemDefault().getId()),
+ listDate.get(endDateIndex), DateUtils.dateToString(listDate.get(endDateIndex), ZoneId.systemDefault().getId()), JSONUtils.toJsonString(CronUtils.getSelfFireDateList(startDate, endDate, schedules)));
+
Review Comment:
```suggestion
String startDateStr = DateUtils.dateToString(startDate, ZoneId.systemDefault().getId());
String endDateStr = DateUtils.dateToString(endDate, ZoneId.systemDefault().getId())
String dateListStr = JSONUtils.toJsonString(CronUtils.getSelfFireDateList(startDate, endDate, schedules));
cmdParam.put(CMDPARAM_COMPLEMENT_DATA_START_DATE, startDateStr);
cmdParam.put(CMDPARAM_COMPLEMENT_DATA_END_DATE, endDateStr);
cmdParam.put(CMDPARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST, dateListStr);
command.setCommandParam(JSONUtils.toJsonString(cmdParam));
logger.info("before create complement command: startDate:{}, startStr:{}, endDate:{}, endStr:{}, complement date list: {}",
startDateStr,
endDateStr, dateListStr);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org