[meld] matchers.helpers: Run our queue check on a timeout to avoid busy-looping



commit 68bf291024c9b7d1837a9ecb27a0aa726e92b49c
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Jul 16 09:03:30 2017 +1000

    matchers.helpers: Run our queue check on a timeout to avoid busy-looping
    
    Ideally we'd be using a GSource or something to avoid this entirely,
    but for now this is fine.

 meld/matchers/helpers.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/meld/matchers/helpers.py b/meld/matchers/helpers.py
index 55cbe59..548b129 100644
--- a/meld/matchers/helpers.py
+++ b/meld/matchers/helpers.py
@@ -67,7 +67,7 @@ class CachedSequenceMatcher(object):
 
     def enqueue_task(self, texts, cb):
         if not bool(self.queued_matches):
-            GLib.idle_add(self.check_results)
+            GLib.timeout_add(10, self.check_results)
         self.queued_matches[self.task_id] = (texts, cb)
         self.tasks.put((self.task_id, texts))
         self.task_id += 1


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