reele commented on code in PR #16796:
URL:
https://github.com/apache/dolphinscheduler/pull/16796#discussion_r1839571888
##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/cluster/WorkerGroupChangeNotifier.java:
##########
@@ -52,15 +55,23 @@ public class WorkerGroupChangeNotifier {
public WorkerGroupChangeNotifier(WorkerGroupDao workerGroupDao) {
this.workerGroupDao = workerGroupDao;
+ }
+
+ public void startScheduleThread() {
detectWorkerGroupChanges();
+ final long workerGroupRefreshIntervalSeconds =
masterConfig.getWorkerGroupRefreshInterval().getSeconds();
MasterThreadFactory.getDefaultSchedulerThreadExecutor().scheduleWithFixedDelay(
this::detectWorkerGroupChanges,
- DEFAULT_REFRESH_WORKER_INTERVAL,
- DEFAULT_REFRESH_WORKER_INTERVAL,
+ workerGroupRefreshIntervalSeconds,
+ workerGroupRefreshIntervalSeconds,
TimeUnit.SECONDS);
}
public void subscribeWorkerGroupsChange(WorkerGroupListener listener) {
+
+ // add all group when listener added
+ listener.onWorkerGroupAdd(new ArrayList<>(workerGroupMap.values()));
+
Review Comment:
yes, it's useless for currently
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]