diff mbox series

[2/2] cooker: Clean up inotify idle handler

Message ID 20230105115156.1212181-2-richard.purdie@linuxfoundation.org
State Accepted, archived
Commit af4ccab8acc49e91bf7647f209d69f4858618466
Headers show
Series [1/2] cooker: Rework the parsing results submission | expand

Commit Message

Richard Purdie Jan. 5, 2023, 11:51 a.m. UTC
We no longer need to abstract the inotify callback handler, remove the
abstraction and simplify/clean up the code.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/cooker.py         | 6 ------
 lib/bb/server/process.py | 5 +++--
 2 files changed, 3 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 1d347ddc52..d2c42c858d 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -190,12 +190,6 @@  class BBCooker:
 
         self.inotify_modified_files = []
 
-        def _process_inotify_updates(server, cooker, halt):
-            cooker.process_inotify_updates()
-            return 1.0
-
-        self.idleCallBackRegister(_process_inotify_updates, self)
-
         # TOSTOP must not be set or our children will hang when they output
         try:
             fd = sys.stdout.fileno()
diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index 78fdc6cf71..4422fd7311 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -158,8 +158,7 @@  class ProcessServer():
     def wait_for_idle(self, timeout=30):
         # Wait for the idle loop to have cleared
         with self.idle_cond:
-            # FIXME - the 1 is the inotify processing in cooker which always runs
-            self.idle_cond.wait_for(lambda: len(self._idlefuns) <= 1, timeout)
+            self.idle_cond.wait_for(lambda: len(self._idlefuns) == 0, timeout)
 
     def main(self):
         self.cooker.pre_serve()
@@ -389,6 +388,8 @@  class ProcessServer():
             nextsleep = 0.1
             fds = []
 
+            self.cooker.process_inotify_updates()
+
             with bb.utils.lock_timeout(self._idlefuncsLock):
                 items = list(self._idlefuns.items())