Added hidden "disable-wal" database option (default: false)
This commit is contained in:
parent
92e030f3e8
commit
840eb3b4ee
2 changed files with 8 additions and 1 deletions
|
|
@ -42,6 +42,7 @@ public class Config extends Language {
|
||||||
public String MYSQL_PASSWORD;
|
public String MYSQL_PASSWORD;
|
||||||
public String LANGUAGE;
|
public String LANGUAGE;
|
||||||
public boolean ENABLE_AWE;
|
public boolean ENABLE_AWE;
|
||||||
|
public boolean DISABLE_WAL;
|
||||||
public boolean HOVER_EVENTS;
|
public boolean HOVER_EVENTS;
|
||||||
public boolean DATABASE_LOCK;
|
public boolean DATABASE_LOCK;
|
||||||
public boolean LOG_CANCELLED_CHAT;
|
public boolean LOG_CANCELLED_CHAT;
|
||||||
|
|
@ -182,6 +183,7 @@ public class Config extends Language {
|
||||||
|
|
||||||
private void readValues() {
|
private void readValues() {
|
||||||
this.ENABLE_AWE = this.getBoolean("enable-awe", false);
|
this.ENABLE_AWE = this.getBoolean("enable-awe", false);
|
||||||
|
this.DISABLE_WAL = this.getBoolean("disable-wal", false);
|
||||||
this.HOVER_EVENTS = this.getBoolean("hover-events", true);
|
this.HOVER_EVENTS = this.getBoolean("hover-events", true);
|
||||||
this.DATABASE_LOCK = this.getBoolean("database-lock", true);
|
this.DATABASE_LOCK = this.getBoolean("database-lock", true);
|
||||||
this.LOG_CANCELLED_CHAT = this.getBoolean("log-cancelled-chat", true);
|
this.LOG_CANCELLED_CHAT = this.getBoolean("log-cancelled-chat", true);
|
||||||
|
|
|
||||||
|
|
@ -302,8 +302,13 @@ public class Database extends Queue {
|
||||||
private static void initializeTables(String prefix, Statement statement) {
|
private static void initializeTables(String prefix, Statement statement) {
|
||||||
try {
|
try {
|
||||||
if (!Config.getGlobal().MYSQL) {
|
if (!Config.getGlobal().MYSQL) {
|
||||||
|
if (!Config.getGlobal().DISABLE_WAL) {
|
||||||
statement.executeUpdate("PRAGMA journal_mode=WAL;");
|
statement.executeUpdate("PRAGMA journal_mode=WAL;");
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
statement.executeUpdate("PRAGMA journal_mode=DELETE;");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
boolean lockInitialized = false;
|
boolean lockInitialized = false;
|
||||||
String query = "SELECT rowid as id FROM " + prefix + "database_lock WHERE rowid='1' LIMIT 1";
|
String query = "SELECT rowid as id FROM " + prefix + "database_lock WHERE rowid='1' LIMIT 1";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue