1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2024-10-27 20:34:16 +00:00

Sqlite: Fix faster wiki loading for read-only devices not working for Read-only files [#534]

This commit is contained in:
gnosygnu 2019-08-08 20:36:36 -04:00
parent 19c50b94be
commit a94279c922

View File

@ -72,7 +72,7 @@ public class Sqlite_engine extends Db_engine_sql_base {
// set open_mode flag if conn is read-only; needed else all SELECT queries will be very slow; DATE:2016-09-03 // set open_mode flag if conn is read-only; needed else all SELECT queries will be very slow; DATE:2016-09-03
IoItmFil sqlite_fs_itm = Io_mgr.Instance.QueryFil(sqlite_fs_url); IoItmFil sqlite_fs_itm = Io_mgr.Instance.QueryFil(sqlite_fs_url);
boolean read_only = sqlite_fs_itm.Exists() // NOTE: must check if it exists; else missing-file will be marked as readonly connection, and missing-file will sometimes be dynamically created as read-write; DATE:2016-09-04 boolean read_only = sqlite_fs_itm.Exists() // NOTE: must check if it exists; else missing-file will be marked as readonly connection, and missing-file will sometimes be dynamically created as read-write; DATE:2016-09-04
&& Io_mgr.Instance.Query_read_only(sqlite_fs_url.OwnerDir(), Sqlite_engine_.Read_only_detection); && Io_mgr.Instance.Query_read_only(sqlite_fs_url, Sqlite_engine_.Read_only_detection);
Keyval[] props = read_only Keyval[] props = read_only
? Keyval_.Ary(Keyval_.new_("open_mode", "1")) ? Keyval_.Ary(Keyval_.new_("open_mode", "1"))
: Keyval_.Ary_empty; : Keyval_.Ary_empty;