# HG changeset patch # User Changaco # Date 1335745234 -7200 # Node ID 94f3b22beec91947919ed50cf95bb4a52e6274b5 # Parent f22369c004804d8ce326b91c6ae71c2cc6fcdc5a use polling in non-fork mode to catch KeyboardInterrupt Signed-off-by: Changaco diff --git a/feed-push b/feed-push --- a/feed-push +++ b/feed-push @@ -319,5 +319,13 @@ if __name__ == '__main__': os.chdir(global_args.config) monitor.watch_directory(global_args.config, handler(handle_config_change)) - while True: - monitor.handle_one_event() + if global_args.fork: + while True: + monitor.handle_one_event() + else: + try: + while True: + monitor.handle_events() + time.sleep(1) + except KeyboardInterrupt: + exit(0)