[tracker/wip/carlosg/domain-ontologies: 5/5] tracker-store: Use wal_checkpoint API from TrackerDBInterface
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/domain-ontologies: 5/5] tracker-store: Use wal_checkpoint API from TrackerDBInterface
- Date: Sun, 25 Jun 2017 14:09:55 +0000 (UTC)
commit b80223be34584b8f694bdff09ab0493e6c7aff0d
Author: Carlos Garnacho <carlosg gnome org>
Date: Sat Jun 24 19:24:24 2017 +0200
tracker-store: Use wal_checkpoint API from TrackerDBInterface
Better than calling the pragma and involving prepared statements
src/tracker-store/tracker-store.vala | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/tracker-store/tracker-store.vala b/src/tracker-store/tracker-store.vala
index 4445575..8b06439 100644
--- a/src/tracker-store/tracker-store.vala
+++ b/src/tracker-store/tracker-store.vala
@@ -254,7 +254,7 @@ public class Tracker.Store {
public static void wal_checkpoint (DBInterface iface) {
try {
debug ("Checkpointing database...");
- iface.execute_query ("PRAGMA wal_checkpoint");
+ iface.sqlite_wal_checkpoint (false);
debug ("Checkpointing complete...");
} catch (Error e) {
warning (e.message);
@@ -271,6 +271,7 @@ public class Tracker.Store {
if (n_pages >= 10000) {
// do immediate checkpointing (blocking updates)
// to prevent excessive wal file growth
+ iface.sqlite_wal_checkpoint (true);
wal_checkpoint (iface);
} else if (n_pages >= 1000) {
if (AtomicInt.compare_and_exchange (ref checkpointing, 0, 1)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]