[tracker/urho-sync] Fixed logic, the timeout is for backup, the max for fsync
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker/urho-sync] Fixed logic, the timeout is for backup, the max for fsync
- Date: Fri, 21 Aug 2009 09:13:25 +0000 (UTC)
commit e329dbca27a1ee5258757a0ff0c051097ecb93a6
Author: Philip Van Hoof <philip codeminded be>
Date: Fri Aug 21 11:12:39 2009 +0200
Fixed logic, the timeout is for backup, the max for fsync
src/tracker-store/tracker-store.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/tracker-store/tracker-store.c b/src/tracker-store/tracker-store.c
index 5c69fb2..98f876b 100644
--- a/src/tracker-store/tracker-store.c
+++ b/src/tracker-store/tracker-store.c
@@ -38,9 +38,9 @@
#include "tracker-store.h"
-#define TRACKER_STORE_TRANSACTION_MAX 4000 /* At commit is journal fsynced too */
-#define TRACKER_STORE_JOURNAL_MAX 2000 /* Amount of queries before fsync */
-#define TRACKER_STORE_JOURNAL_TIMEOUT (60 * 60 * 2) /* Two hours before fsync */
+#define TRACKER_STORE_TRANSACTION_MAX 4000 /* At commit is journal fsynced too */
+#define TRACKER_STORE_JOURNAL_MAX_BEFORE_FLUSH 2000 /* Amount of queries before fsync */
+#define TRACKER_STORE_JOURNAL_TIMEOUT_BEFORE_BACKUP (60 * 60 * 2) /* Two hours before backup */
typedef struct {
gboolean have_handler, have_sync_handler;
@@ -173,8 +173,9 @@ log_to_journal (TrackerStorePrivate *private, const gchar *query)
tracker_db_journal_log (query);
private->journal_log_count++;
- if (private->journal_log_count >= TRACKER_STORE_JOURNAL_MAX) {
- tracker_db_backup_save (on_backup_done, private, NULL);
+ if (private->journal_log_count >= TRACKER_STORE_JOURNAL_MAX_BEFORE_FLUSH) {
+ tracker_store_flush_journal ();
+ private->journal_log_count = 0;
}
}
@@ -363,7 +364,7 @@ tracker_store_init (gboolean load_journal)
private->start_log = TRUE;
private->sync_handler = g_timeout_add_seconds_full (G_PRIORITY_LOW,
- TRACKER_STORE_JOURNAL_TIMEOUT,
+ TRACKER_STORE_JOURNAL_TIMEOUT_BEFORE_BACKUP,
sync_idle_handler,
private,
sync_idle_destroy);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]