[tracker-miners/wip/carlosg/cli-improvements: 17/30] tracker-extract: Avoid shutdown timeout if running from a terminal




commit 4f55d01a3fd42cffac942857910545ff24f0f4ba
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Aug 17 17:59:55 2020 +0200

    tracker-extract: Avoid shutdown timeout if running from a terminal
    
    Not strictly an user-facing CLI improvement, but this has been bugging
    me forever. Make tracker-extract whether it's running on a tty, and avoid
    the shutdown timeout in that case.
    
    This is useful for debugging, as you can fire tracker-extract up, and
    have it wait for triggered events, instead of timing everything perfectly.

 src/tracker-extract/tracker-main.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/src/tracker-extract/tracker-main.c b/src/tracker-extract/tracker-main.c
index 72c79fd5b..36c282137 100644
--- a/src/tracker-extract/tracker-main.c
+++ b/src/tracker-extract/tracker-main.c
@@ -270,6 +270,13 @@ on_decorator_finished (TrackerDecorator *decorator,
 {
        if (shutdown_timeout_id != 0)
                return;
+
+       /* For debugging convenience, avoid the shutdown timeout if running
+        * on a terminal.
+        */
+       if (tracker_term_is_tty ())
+               return;
+
        shutdown_timeout_id = g_timeout_add_seconds (10, shutdown_timeout_cb,
                                                     main_loop);
 }


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