Buffer setting save (#51)

This makes it so that settings are written to disk 1 second after settings have stopped being changed. This means that while dragging sliders in the UI, settings won't be written repeatedly. This reduces wear on system storage and improves performance, as saving is expensive.
This commit is contained in:
Matt
2020-08-17 13:25:28 -07:00
committed by GitHub
parent 38099e79cf
commit 87186809c9
6 changed files with 28 additions and 15 deletions

View File

@@ -46,8 +46,7 @@ public class Main {
public static final int DEFAULT_WEBPORT = 5800;
private static final Logger logger = new Logger(Main.class, LogGroup.General);
private static final boolean isRelease =
!PhotonVersion.isRelease; // Hack!!!! Until PhotonVersion script fixed
private static final boolean isRelease = PhotonVersion.isRelease;
private static boolean isTestMode;
private static boolean printDebugLogs;
@@ -146,6 +145,7 @@ public class Main {
logger.error("Failed to parse command-line options!", e);
}
System.out.println("Running in " + (isRelease ? "release" : "development") + " mode!");
var logLevel = (isRelease || printDebugLogs) ? LogLevel.INFO : LogLevel.DEBUG;
Logger.setLevel(LogGroup.Camera, logLevel);
Logger.setLevel(LogGroup.WebServer, logLevel);