From fae23df6eb544ccef2df6ee0843dc1ea1020af06 Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Mon, 17 Feb 2025 14:37:09 +0530 Subject: [PATCH] [mob] refactor --- mobile/lib/db/remote/db.dart | 5 ----- 1 file changed, 5 deletions(-) diff --git a/mobile/lib/db/remote/db.dart b/mobile/lib/db/remote/db.dart index a8573e92cd..eb42d917bf 100644 --- a/mobile/lib/db/remote/db.dart +++ b/mobile/lib/db/remote/db.dart @@ -43,19 +43,14 @@ class RemoteDB { Future insertCollections(List collections) async { if (collections.isEmpty) return; final stopwatch = Stopwatch()..start(); - int inserted = 0; await Future.forEach(collections.slices(_batchInsertMaxCount), (slice) async { - debugPrint( - '$runtimeType insertCollections inserting slice of [${inserted + 1}, ${inserted + slice.length}] entries', - ); final List> values = slice.map((e) => e.rowValiues()).toList(); await _sqliteDB.executeBatch( 'INSERT OR REPLACE INTO collections ($collectionColumns) values($collectionValuePlaceHolder)', values, ); - inserted += slice.length; }); debugPrint( '$runtimeType insertCollections complete in ${stopwatch.elapsed.inMilliseconds}ms for ${collections.length} collections',