def run():
    setup_logger()
    logger.info('Started')
    event_handler = EventHandler()
    observer = Observer(timeout=0.1)
    observer.event_queue.maxsize = EVENT_QUEUE_MAX_SIZE
    try:
        delete_all_files(FRAMES_PATH)
        observer.schedule(event_handler, path=FRAMES_PATH, recursive=True)
        observer.start()

        while True:
            time.sleep(1)
            now = datetime.datetime.now()
            if now - event_handler.last_event > datetime.timedelta(minutes=1):
                logger.warning("No events received in the last minute.")
                # Sometimes watchdog stops receiving events.
                # We exit, so the process can be restarted.
                break
    except __HOLE__ as err:
        logger.warning("Keyboard interruption")
    except Exception as err:
        logger.exception(err)
    finally:
        observer.stop()
    observer.join()
    logger.warning("Bye")
dataset/ETHPy150Open jbochi/live_thumb/broadcaster.py/run