[tracker-miners/wip/carlosg/shuffle-libtracker-miner: 27/116] libtracker-miner: Remove dead TrackerMonitor code



commit f5a733f0677fcfe84df27c4f860a2ea198820a33
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Oct 18 23:15:12 2017 +0200

    libtracker-miner: Remove dead TrackerMonitor code
    
    The PAUSE_ON_IO feature required someone to notice it and
    modify tracker code to #define instead of #undef. I discovered
    it before, and chose to remove it instead.

 src/libtracker-miner/tracker-monitor.c | 59 ----------------------------------
 1 file changed, 59 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-monitor.c b/src/libtracker-miner/tracker-monitor.c
index b415f8cbd..9a709d240 100644
--- a/src/libtracker-miner/tracker-monitor.c
+++ b/src/libtracker-miner/tracker-monitor.c
@@ -52,17 +52,6 @@
 /* The life time of an item in the cache */
 #define CACHE_LIFETIME_SECONDS 1
 
-/* When we receive IO monitor events, we pause sending information to
- * the indexer for a few seconds before continuing. We have to receive
- * NO events for at least a few seconds before unpausing.
- */
-#define PAUSE_ON_IO_SECONDS    5
-
-/* If this is defined, we pause the indexer when we get events. If it
- * is not, we don't do any pausing.
- */
-#undef  PAUSE_ON_IO
-
 struct TrackerMonitorPrivate {
        GHashTable    *monitors;
 
@@ -79,11 +68,6 @@ struct TrackerMonitorPrivate {
         */
        gboolean       use_changed_event;
 
-#ifdef PAUSE_ON_IO
-       /* Timeout id for pausing when we get IO */
-       guint          unpause_timeout_id;
-#endif /* PAUSE_ON_IO */
-
        GHashTable    *pre_update;
        GHashTable    *pre_delete;
        guint          event_pairs_timeout_id;
@@ -360,12 +344,6 @@ tracker_monitor_finalize (GObject *object)
 
        priv = TRACKER_MONITOR_GET_PRIVATE (object);
 
-#ifdef PAUSE_ON_IO
-       if (priv->unpause_timeout_id) {
-               g_source_remove (priv->unpause_timeout_id);
-       }
-#endif /* PAUSE_ON_IO */
-
        if (priv->event_pairs_timeout_id) {
                g_source_remove (priv->event_pairs_timeout_id);
        }
@@ -463,27 +441,6 @@ get_inotify_limit (void)
        return limit;
 }
 
-#ifdef PAUSE_ON_IO
-
-static gboolean
-unpause_cb (gpointer data)
-{
-       TrackerMonitor *monitor;
-
-       monitor = data;
-
-       g_message ("Resuming indexing now we have stopped "
-                  "receiving monitor events for %d seconds",
-                  PAUSE_ON_IO_SECONDS);
-
-       monitor->priv->unpause_timeout_id = 0;
-       tracker_status_set_is_paused_for_io (FALSE);
-
-       return FALSE;
-}
-
-#endif /* PAUSE_ON_IO */
-
 static gboolean
 check_is_directory (TrackerMonitor *monitor,
                     GFile          *file)
@@ -1298,22 +1255,6 @@ monitor_event_cb (GFileMonitor      *file_monitor,
                         other_file_uri);
        }
 
-#ifdef PAUSE_ON_IO
-       if (monitor->priv->unpause_timeout_id != 0) {
-               g_source_remove (monitor->priv->unpause_timeout_id);
-       } else {
-               g_message ("Pausing indexing because we are "
-                          "receiving monitor events");
-
-               tracker_status_set_is_paused_for_io (TRUE);
-       }
-
-       monitor->priv->unpause_timeout_id =
-               g_timeout_add_seconds (PAUSE_ON_IO_SECONDS,
-                                      unpause_cb,
-                                      monitor);
-#endif /* PAUSE_ON_IO */
-
        if (!is_directory) {
                /* FILE Events */
                switch (event_type) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]