[tracker/miner-priority-queues: 6/7] libtracker-miner: Ensure harder process_stop() is only called once
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/miner-priority-queues: 6/7] libtracker-miner: Ensure harder process_stop() is only called once
- Date: Thu, 7 Jul 2011 10:24:32 +0000 (UTC)
commit 90c94a480a1265f64f6cf132108adef263483257
Author: Carlos Garnacho <carlos lanedo com>
Date: Wed Jul 6 16:56:38 2011 +0200
libtracker-miner: Ensure harder process_stop() is only called once
QUEUE_WAIT is now used more extensively, meaning item_queue_handlers_cb()
onky gets QUEUE_NONE if there really is nothing left to process, be it
items in the task pool, pending to be crawled, or in the processing queues.
src/libtracker-miner/tracker-miner-fs.c | 25 +++++++++++++++++--------
1 files changed, 17 insertions(+), 8 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 1f68f1b..9411d71 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -2716,6 +2716,18 @@ item_queue_get_next_file (TrackerMinerFS *fs,
*file = NULL;
*source_file = NULL;
+ if (fs->priv->is_crawling ||
+ fs->priv->crawl_directories_id != 0 ||
+ !tracker_priority_queue_is_empty (fs->priv->crawled_directories) ||
+ !tracker_priority_queue_is_empty (fs->priv->directories) ||
+ tracker_task_pool_limit_reached (fs->priv->task_pool) ||
+ tracker_task_pool_limit_reached (TRACKER_TASK_POOL (fs->priv->sparql_buffer))) {
+ /* There are still pending items to crawl,
+ * or extract pool limit is reached
+ */
+ return QUEUE_WAIT;
+ }
+
return QUEUE_NONE;
}
@@ -2901,17 +2913,13 @@ item_queue_handlers_cb (gpointer user_data)
/* Handle queues */
switch (queue) {
case QUEUE_NONE:
- /* Print stats and signal finished */
- if (!fs->priv->is_crawling &&
- tracker_task_pool_get_size (fs->priv->task_pool) == 0 &&
- tracker_task_pool_get_size (TRACKER_TASK_POOL (fs->priv->sparql_buffer)) == 0) {
- process_stop (fs);
- }
-
/* Flush any possible pending update here */
tracker_sparql_buffer_flush (fs->priv->sparql_buffer,
"Queue handlers NONE");
+ /* Print stats and signal finished */
+ process_stop (fs);
+
tracker_thumbnailer_send ();
tracker_albumart_check_cleanup (tracker_miner_get_connection (TRACKER_MINER (fs)));
/* No more files left to process */
@@ -5060,7 +5068,8 @@ tracker_miner_fs_has_items_to_process (TrackerMinerFS *fs)
{
g_return_val_if_fail (TRACKER_IS_MINER_FS (fs), FALSE);
- if (!tracker_priority_queue_is_empty (fs->priv->items_deleted) ||
+ if (!tracker_priority_queue_is_empty (fs->priv->crawled_directories) ||
+ !tracker_priority_queue_is_empty (fs->priv->items_deleted) ||
!tracker_priority_queue_is_empty (fs->priv->items_created) ||
!tracker_priority_queue_is_empty (fs->priv->items_updated) ||
!tracker_priority_queue_is_empty (fs->priv->items_moved)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]