[tracker/miner-fs-no-infinite-loops: 7/7] libtracker-miner: Make reentry maximum (2) a #define and update error given
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/miner-fs-no-infinite-loops: 7/7] libtracker-miner: Make reentry maximum (2) a #define and update error given
- Date: Tue, 3 Jul 2012 17:43:12 +0000 (UTC)
commit 1f881b214be75ac7b5aa4bcdc341d6c849174b1a
Author: Martyn Russell <martyn lanedo com>
Date: Tue Jul 3 18:34:26 2012 +0100
libtracker-miner: Make reentry maximum (2) a #define and update error given
src/libtracker-miner/tracker-miner-fs.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index f3511c7..e5fec2e 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -89,6 +89,11 @@ static gboolean miner_fs_queues_status_trace_timeout_cb (gpointer data);
#define trace_eq_pop_head_2(...)
#endif /* EVENT_QUEUE_ENABLE_TRACE */
+/* Number of times a GFile can be re-queued before it's dropped for
+ * whatever reason to avoid infinite loops.
+*/
+#define REENTRY_MAX 2
+
/* Default processing pool limits to be set */
#define DEFAULT_WAIT_POOL_LIMIT 1
#define DEFAULT_READY_POOL_LIMIT 1
@@ -1797,7 +1802,7 @@ item_reenqueue_full (TrackerMinerFS *fs,
reentry_counter = GPOINTER_TO_INT (g_object_get_qdata (G_OBJECT (queue_file),
fs->priv->quark_reentry_counter));
- if (reentry_counter < 2) {
+ if (reentry_counter < REENTRY_MAX) {
g_object_set_qdata (G_OBJECT (queue_file),
fs->priv->quark_reentry_counter,
GINT_TO_POINTER (reentry_counter + 1));
@@ -1806,7 +1811,7 @@ item_reenqueue_full (TrackerMinerFS *fs,
should_wait = TRUE;
} else {
uri = g_file_get_uri (queue_file);
- g_warning ("File '%s' has been reenqueued more than twice. It will not be indexed.", uri);
+ g_warning ("File '%s' has been reenqueued more than %d times. It will not be indexed.", uri, REENTRY_MAX);
g_free (uri);
/* We must be careful not to return QUEUE_WAIT when there's actually
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]