Build 334

- Disable WAL
This commit is contained in:
Hanh 2022-12-24 01:40:01 +08:00
parent 3ec9b73d4a
commit 321fea73fd
4 changed files with 9 additions and 14 deletions

View File

@ -47,9 +47,6 @@
<meta-data <meta-data
android:name="flutterEmbedding" android:name="flutterEmbedding"
android:value="2" /> android:value="2" />
<meta-data
android:name="com.tekartik.sqflite.wal_enabled"
android:value="true" />
<service android:name="com.pravera.flutter_foreground_task.service.ForegroundService" /> <service android:name="com.pravera.flutter_foreground_task.service.ForegroundService" />
</application> </application>
<queries> <queries>

View File

@ -43,12 +43,12 @@ abstract class CoinBase {
bool exists() => File(dbFullPath).existsSync(); bool exists() => File(dbFullPath).existsSync();
Future<void> open(bool wal) async { Future<void> open(bool delete_wal) async {
print("Opening DB ${dbFullPath}"); print("Opening DB ${dbFullPath}, delete_wal = ${delete_wal}");
// schema handled in backend // schema handled in backend
db = await openDatabase(dbFullPath, onConfigure: (db) async { db = await openDatabase(dbFullPath, onConfigure: (db) async {
if (wal) if (delete_wal)
await db.rawQuery("PRAGMA journal_mode=WAL"); await db.rawQuery("PRAGMA journal_mode=DELETE");
}); });
} }

View File

@ -348,10 +348,8 @@ class ZWalletAppState extends State<ZWalletApp> {
final dbPath = await getDbPath(); final dbPath = await getDbPath();
for (var coin in coins) { for (var coin in coins) {
coin.init(dbPath); coin.init(dbPath);
if (!coin.exists()) { await coin.open(true);
await coin.open(false); await coin.close();
await coin.close();
}
} }
if (exportDb) { if (exportDb) {
@ -362,7 +360,7 @@ class ZWalletAppState extends State<ZWalletApp> {
if (recover) { if (recover) {
for (var coin in coins) { for (var coin in coins) {
await coin.importFromTemp(); await coin.importFromTemp();
await coin.open(false); await coin.open(true);
await coin.close(); await coin.close();
} }
} }
@ -383,7 +381,7 @@ class ZWalletAppState extends State<ZWalletApp> {
} }
for (var coin in coins) { for (var coin in coins) {
await coin.open(true); await coin.open(false);
} }
_setProgress(0.6, 'Loading Account Data'); _setProgress(0.6, 'Loading Account Data');

View File

@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at # Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.2.17+333 version: 1.2.17+334
environment: environment:
sdk: ">=2.12.0 <3.0.0" sdk: ">=2.12.0 <3.0.0"