Skip to content

Commit

Permalink
Call method to ensure class is initialized before constructor returns
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljmarshall committed Feb 10, 2021
1 parent fffac55 commit cd109ef
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ public LinuxBrokerHostUsageImpl(int hostUsageCheckIntervalMin,
}
this.isCGroupsEnabled = isCGroupsEnabled;

executorService.scheduleAtFixedRate(this::calculateBrokerHostUsage, 0,
// Call now to initialize values before the constructor returns
calculateBrokerHostUsage();
executorService.scheduleAtFixedRate(this::calculateBrokerHostUsage, hostUsageCheckIntervalMin,
hostUsageCheckIntervalMin, TimeUnit.MINUTES);
}

Expand Down

0 comments on commit cd109ef

Please sign in to comment.