[tracker-miners/wip/carlosg/parallel-installable: 15/34] tracker-miner-fs: Remove unneeded tracker store alive check



commit 73f1c31dae0471e0e19378d2a17f4022699b80c1
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Feb 23 18:51:07 2020 +0100

    tracker-miner-fs: Remove unneeded tracker store alive check
    
    There's no tracker-store process anymore, the store is managed in
    process and always available.

 src/miners/fs/tracker-main.c | 63 ++++----------------------------------------
 1 file changed, 5 insertions(+), 58 deletions(-)
---
diff --git a/src/miners/fs/tracker-main.c b/src/miners/fs/tracker-main.c
index 990bada58..894eda94f 100644
--- a/src/miners/fs/tracker-main.c
+++ b/src/miners/fs/tracker-main.c
@@ -671,56 +671,14 @@ check_eligible (void)
 }
 
 static gboolean
-store_is_available (void)
-{
-       GDBusConnection *connection;
-       GDBusProxy *proxy;
-       gchar *name_owner;
-
-       connection = g_bus_get_sync (TRACKER_IPC_BUS, NULL, NULL);
-
-       if (!connection) {
-               return FALSE;
-       }
-
-       proxy = g_dbus_proxy_new_sync (connection,
-                                      G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
-                                      NULL,
-                                      "org.freedesktop.Tracker1",
-                                      "/org/freedesktop/Tracker1/Status",
-                                      "org.freedesktop.Tracker1.Status",
-                                      NULL, NULL);
-
-       if (!proxy) {
-               g_object_unref (connection);
-               return FALSE;
-       }
-
-       name_owner = g_dbus_proxy_get_name_owner (proxy);
-
-       g_object_unref (connection);
-       g_object_unref (proxy);
-
-       if (name_owner) {
-               g_free (name_owner);
-               return TRUE;
-       }
-
-       return FALSE;
-}
-
-static gboolean
-miner_needs_check (TrackerMiner *miner,
-                   gboolean      store_available)
+miner_needs_check (TrackerMiner *miner)
 {
        /* Reasons to not mark ourselves as cleanly shutdown include:
         *
         * 1. Still crawling or with files to process in our queues.
         * 2. We crash (out of our control usually anyway).
         * 3. At least one of the miners is PAUSED, we have
-        *    to exclude the situations where the miner is
-        *    exclusively paused due to the store not being
-        *    available, but the miner is actually done.
+        *    to exclude the situations where the miner is actually done.
         */
        if (!tracker_miner_is_paused (miner)) {
                if (tracker_miner_fs_has_items_to_process (TRACKER_MINER_FS (miner))) {
@@ -736,15 +694,8 @@ miner_needs_check (TrackerMiner *miner,
                /* We consider the miner finished */
                return FALSE;
        } else {
-               if (store_available) {
-                       /* Paused for other reasons, so probably not done */
-                       return TRUE;
-               } else {
-                       /* Check whether there are more pause
-                        * reasons than the store being out.
-                        */
-                       return tracker_miner_is_paused (miner);
-               }
+               /* Paused for other reasons, so probably not done */
+               return TRUE;
        }
 }
 
@@ -821,7 +772,6 @@ main (gint argc, gchar *argv[])
        gchar *log_filename = NULL;
        gboolean do_mtime_checking;
        gboolean force_mtime_checking = FALSE;
-       gboolean store_available;
        TrackerMinerProxy *proxy;
        GDBusConnection *connection;
        TrackerSparqlConnection *sparql_conn;
@@ -1044,10 +994,7 @@ main (gint argc, gchar *argv[])
 
        g_message ("Shutdown started");
 
-       store_available = store_is_available ();
-
-       if (miners_timeout_id == 0 &&
-           !miner_needs_check (miner_files, store_available)) {
+       if (miners_timeout_id == 0 && !miner_needs_check (miner_files)) {
                tracker_miner_files_set_need_mtime_check (FALSE);
                save_current_locale ();
        }


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