3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-25 15:50:14 +01:00

Move leak detector to standalone bootstrap class

Dieser Commit ist enthalten in:
Redned 2021-07-18 17:44:08 -05:00 committet von RednedEpic
Ursprung 39324ce95d
Commit 1a0ac26398
2 geänderte Dateien mit 5 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -30,6 +30,7 @@ import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.introspect.AnnotatedField;
import com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition;
import io.netty.util.ResourceLeakDetector;
import lombok.Getter;
import net.minecrell.terminalconsole.TerminalConsoleAppender;
import org.apache.logging.log4j.Level;
@ -80,6 +81,10 @@ public class GeyserStandaloneBootstrap implements GeyserBootstrap {
private static final Map<String, String> argsConfigKeys = new HashMap<>();
public static void main(String[] args) {
if (System.getProperty("io.netty.leakDetection.level") == null) {
ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.DISABLED); // Can eat performance
}
GeyserStandaloneBootstrap bootstrap = new GeyserStandaloneBootstrap();
// Set defaults
boolean useGuiOpts = bootstrap.useGui;

Datei anzeigen

@ -34,7 +34,6 @@ import com.nukkitx.network.util.EventLoops;
import com.nukkitx.protocol.bedrock.BedrockServer;
import io.netty.channel.epoll.Epoll;
import io.netty.channel.kqueue.KQueue;
import io.netty.util.ResourceLeakDetector;
import lombok.Getter;
import lombok.Setter;
import org.geysermc.common.PlatformType;
@ -126,10 +125,6 @@ public class GeyserConnector {
private Metrics metrics;
private GeyserConnector(PlatformType platformType, GeyserBootstrap bootstrap) {
if (platformType == PlatformType.STANDALONE && System.getProperty("io.netty.leakDetection.level") == null) {
ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.DISABLED); // Can eat performance
}
long startupTime = System.currentTimeMillis();
instance = this;