Skip to content

Commit

Permalink
Merge pull request #6 from reele/fix-cant-detect-workgroup
Browse files Browse the repository at this point in the history
fix can't detect workgroup
  • Loading branch information
reele authored Nov 13, 2024
2 parents 928b215 + 24723b7 commit 64f2d3a
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.commons.collections4.CollectionUtils;

import java.time.Duration;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand All @@ -43,7 +44,7 @@
@Component
public class WorkerGroupChangeNotifier {

private static final long DEFAULT_REFRESH_WORKER_INTERVAL = Duration.ofMinutes(1).toMillis();
private static final long DEFAULT_REFRESH_WORKER_INTERVAL = 10;

private final WorkerGroupDao workerGroupDao;
private final List<WorkerGroupListener> listeners = new CopyOnWriteArrayList<>();
Expand All @@ -61,6 +62,10 @@ public WorkerGroupChangeNotifier(WorkerGroupDao workerGroupDao) {
}

public void subscribeWorkerGroupsChange(WorkerGroupListener listener) {

//add all group when listener added
listener.onWorkerGroupAdd(new ArrayList<>(workerGroupMap.values()));

listeners.add(listener);
}

Expand Down

0 comments on commit 64f2d3a

Please sign in to comment.