[tracker/checkpoint] tracker-store: Fix Resources.Sync with disabled journal
- From: JÃrg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/checkpoint] tracker-store: Fix Resources.Sync with disabled journal
- Date: Tue, 28 Jun 2011 12:03:23 +0000 (UTC)
commit a04d34fc620a5e5ecb3a1f9b54bf322302ba1f72
Author: JÃrg Billeter <j bitron ch>
Date: Tue Jun 28 13:59:11 2011 +0200
tracker-store: Fix Resources.Sync with disabled journal
src/libtracker-data/tracker-data-update.c | 2 ++
src/tracker-store/tracker-resources.vala | 3 +++
src/tracker-store/tracker-store.vala | 2 +-
3 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 73f8ce5..8bb1e42 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -3223,7 +3223,9 @@ tracker_data_load_turtle_file (GFile *file,
void
tracker_data_sync (void)
{
+#ifndef DISABLE_JOURNAL
tracker_db_journal_fsync ();
+#endif
}
#ifndef DISABLE_JOURNAL
diff --git a/src/tracker-store/tracker-resources.vala b/src/tracker-store/tracker-resources.vala
index 2615f71..cd7b6eb 100644
--- a/src/tracker-store/tracker-resources.vala
+++ b/src/tracker-store/tracker-resources.vala
@@ -164,6 +164,9 @@ public class Tracker.Resources : Object {
public void sync (BusName sender) {
var request = DBusRequest.begin (sender, "Resources.Sync");
+ // wal checkpoint implies sync
+ Tracker.Store.wal_checkpoint ();
+ // sync journal if available
Data.sync ();
request.end ();
diff --git a/src/tracker-store/tracker-store.vala b/src/tracker-store/tracker-store.vala
index ec4b0e9..2f4ad81 100644
--- a/src/tracker-store/tracker-store.vala
+++ b/src/tracker-store/tracker-store.vala
@@ -248,7 +248,7 @@ public class Tracker.Store {
});
}
- static void wal_checkpoint () {
+ public static void wal_checkpoint () {
try {
debug ("Checkpointing database...");
var iface = DBManager.get_db_interface ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]