Skip to content

Commit

Permalink
scheduledPersistService reset to final and constructed in the constru…
Browse files Browse the repository at this point in the history
…ctor
  • Loading branch information
gaoyf committed Jun 9, 2023
1 parent dcc87bd commit d9d2f65
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public class ScheduleMessageService extends ConfigManager {
private DataVersion dataVersion = new DataVersion();
private boolean enableAsyncDeliver = false;
private ScheduledExecutorService handleExecutorService;
private ScheduledExecutorService scheduledPersistService;
private final ScheduledExecutorService scheduledPersistService;
private final Map<Integer /* level */, LinkedBlockingQueue<PutResultProcess>> deliverPendingTable =
new ConcurrentHashMap<>(32);
private final BrokerController brokerController;
Expand All @@ -91,6 +91,8 @@ public class ScheduleMessageService extends ConfigManager {
public ScheduleMessageService(final BrokerController brokerController) {
this.brokerController = brokerController;
this.enableAsyncDeliver = brokerController.getMessageStoreConfig().isEnableScheduleAsyncDeliver();
scheduledPersistService = new ScheduledThreadPoolExecutor(1,
new ThreadFactoryImpl("ScheduleMessageServicePersistThread", true, brokerController.getBrokerConfig()));
}

public static int queueId2DelayLevel(final int queueId) {
Expand Down Expand Up @@ -152,8 +154,6 @@ public void start() {
}
}

scheduledPersistService = new ScheduledThreadPoolExecutor(1,
new ThreadFactoryImpl("ScheduleMessageServicePersistThread", true, brokerController.getBrokerConfig()));
scheduledPersistService.scheduleAtFixedRate(() -> {
try {
ScheduleMessageService.this.persist();
Expand Down

0 comments on commit d9d2f65

Please sign in to comment.