[tracker] libtracker-data: Set synchronous = NORMAL with --disable-journal
- From: JÃrg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-data: Set synchronous = NORMAL with --disable-journal
- Date: Wed, 29 Jun 2011 15:35:35 +0000 (UTC)
commit 42305de49bacdbf2379e9628bbfee8eeaa91de8d
Author: JÃrg Billeter <j bitron ch>
Date: Thu Jun 23 12:59:35 2011 +0200
libtracker-data: Set synchronous = NORMAL with --disable-journal
This prevents database corruption followed by expensive journal replay
on OS crash or loss of power.
src/libtracker-data/tracker-db-manager.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-db-manager.c b/src/libtracker-data/tracker-db-manager.c
index e771970..d65f398 100644
--- a/src/libtracker-data/tracker-db-manager.c
+++ b/src/libtracker-data/tracker-db-manager.c
@@ -233,7 +233,11 @@ db_set_params (TrackerDBInterface *iface,
GError *internal_error = NULL;
TrackerDBStatement *stmt;
+#ifdef DISABLE_JOURNAL
+ tracker_db_interface_execute_query (iface, NULL, "PRAGMA synchronous = NORMAL;");
+#else
tracker_db_interface_execute_query (iface, NULL, "PRAGMA synchronous = OFF;");
+#endif /* DISABLE_JOURNAL */
tracker_db_interface_execute_query (iface, NULL, "PRAGMA count_changes = 0;");
tracker_db_interface_execute_query (iface, NULL, "PRAGMA temp_store = FILE;");
tracker_db_interface_execute_query (iface, NULL, "PRAGMA encoding = \"UTF-8\"");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]