[tracker/miner-userguide: 5/13] libtracker-miner: Fix buffer control in TrackerMinerFS
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/miner-userguide: 5/13] libtracker-miner: Fix buffer control in TrackerMinerFS
- Date: Thu, 24 Nov 2011 14:34:42 +0000 (UTC)
commit 4c65806d1be6c70e329ddf26b5e43d32fb5b2277
Author: Carlos Garnacho <carlos lanedo com>
Date: Wed Nov 23 18:09:49 2011 +0100
libtracker-miner: Fix buffer control in TrackerMinerFS
Add an explicit check on item_queue_handlers_cb() to check the
sparql buffer status, so it doesn't have an opportunity to clog
it any further.
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 974ba6d..d764720 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -2946,7 +2946,7 @@ item_queue_get_progress (TrackerMinerFS *fs,
static gboolean
item_queue_handlers_cb (gpointer user_data)
{
- TrackerMinerFS *fs;
+ TrackerMinerFS *fs = user_data;
GFile *file = NULL;
GFile *source_file = NULL;
GFile *parent;
@@ -2956,7 +2956,12 @@ item_queue_handlers_cb (gpointer user_data)
gboolean keep_processing = TRUE;
gint priority = 0;
- fs = user_data;
+ if (tracker_task_pool_limit_reached (TRACKER_TASK_POOL (fs->priv->sparql_buffer))) {
+ /* Task pool is full, give it a break */
+ fs->priv->item_queues_handler_id = 0;
+ return FALSE;
+ }
+
queue = item_queue_get_next_file (fs, &file, &source_file, &priority);
if (queue == QUEUE_WAIT) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]