From: Evan Broder Date: Thu, 31 Dec 2009 20:16:46 +0000 (-0500) Subject: Since we're moving the queue entries into the queue directory for X-Git-Tag: 0.1.5~32 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-dev.git/commitdiff_plain/2ee02cdc057d7d01ab6abda0b351bf47dd4066f8 Since we're moving the queue entries into the queue directory for atomicity, we need to inotify on both IN_CREATE and IN_MOVED_TO events. svn path=/trunk/packages/invirt-dev/; revision=2820 --- diff --git a/invirtibuilder b/invirtibuilder index 32744ae..ff82d4e 100755 --- a/invirtibuilder +++ b/invirtibuilder @@ -353,10 +353,10 @@ def build(): class Invirtibuilder(pyinotify.ProcessEvent): """Process inotify triggers to build new packages.""" - def process_IN_CREATE(self, event): - """Handle a created file or directory. + def process_default(self, event): + """Handle an inotify event. - When an IN_CREATE event comes in, trigger the builder. + When an inotify event comes in, trigger the builder. """ build() @@ -369,7 +369,8 @@ def main(): invirtibuilder = Invirtibuilder() notifier = pyinotify.Notifier(watch_manager, invirtibuilder) watch_manager.add_watch(b._QUEUE_DIR, - pyinotify.EventsCodes.ALL_FLAGS['IN_CREATE']) + pyinotify.EventsCodes.ALL_FLAGS['IN_CREATE'] | + pyinotify.EventsCodes.ALL_FLAGS['IN_MOVED_TO']) # Before inotifying, run any pending builds; otherwise we won't # get notified for them.