Exemplo n.º 1
0
def finish_backend_startup():
    """Last bit of startup required before we load the frontend.  """
    # Uncomment the next line to test startup error handling
    # raise StartupError("Test Error", "Startup Failed")
    reconnect_downloaders()
    guide.download_guides()
    feed.remove_orphaned_feed_impls()
    messages.StartupSuccess().send_to_frontend()
Exemplo n.º 2
0
def finish_backend_startup():
    """Last bit of startup required before we load the frontend.  """
    # Uncomment the next line to test startup error handling
    # raise StartupError("Test Error", "Startup Failed")
    reconnect_downloaders()
    guide.download_guides()
    feed.remove_orphaned_feed_impls()
    messages.StartupSuccess().send_to_frontend()
Exemplo n.º 3
0
Arquivo: startup.py Projeto: ndim/miro
def on_frontend_started():
    """Perform startup actions that should happen after the frontend is
    already up and running.

    This function happens using an idle iterator.  Before/after code that
    could take a while to run, we yield to other eventloop callbacks.
    """
    conversions.conversion_manager.startup()
    item.setup_metadata_manager()

    item.setup_change_tracker()
    app.sharing_tracker = sharing.SharingTracker()
    app.sharing_manager.startup()
    app.sharing_tracker.start_tracking()

    app.device_manager = devices.DeviceManager()
    app.device_tracker = devicetracker.DeviceTracker()
    app.device_tracker.start_tracking()

    reconnect_downloaders()
    guide.download_guides()
    feed.remove_orphaned_feed_impls()

    app.download_state_manager = downloader.DownloadStateManager()
    app.download_state_manager.init_controller()
    itemsource.setup_handlers()
    if app.frontend_name == 'widgets':
        app.donate_manager = donate.DonateManager()
    else:
        logging.warn("frontend is %s, not starting DonateManager()",
                     app.frontend_name)

    logging.info("Starting auto downloader...")
    autodler.start_downloader()
    app.icon_cache_updater.start_updates()
    yield None
    feed.expire_items()
    yield None
    commandline.startup()
    yield None
    autoupdate.check_for_updates()
    yield None
    app.local_metadata_manager.schedule_retry_net_lookup()
    # Delay running high CPU/IO operations for a bit
    eventloop.add_timeout(5, app.download_state_manager.startup_downloader,
            "start downloader daemon")
    eventloop.add_timeout(10, workerprocess.startup,
            "start worker process")
    eventloop.add_timeout(20, item.start_deleted_checker,
            "start checking deleted items")
    eventloop.add_timeout(30, feed.start_updates, "start feed updates")
    eventloop.add_timeout(60, item.update_incomplete_metadata,
            "update metadata data")
    eventloop.add_timeout(90, clear_icon_cache_orphans, "clear orphans")
Exemplo n.º 4
0
def on_frontend_started():
    """Perform startup actions that should happen after the frontend is
    already up and running.

    This function happens using an idle iterator.  Before/after code that
    could take a while to run, we yield to other eventloop callbacks.
    """
    conversions.conversion_manager.startup()

    app.sharing_tracker = sharing.SharingTracker()
    app.sharing_manager.startup()
    app.sharing_tracker.start_tracking()

    app.device_manager = devices.DeviceManager()
    app.device_tracker = devicetracker.DeviceTracker()
    app.device_tracker.start_tracking()

    reconnect_downloaders()
    guide.download_guides()
    feed.remove_orphaned_feed_impls()

    app.download_state_manager.init_controller()
    itemsource.setup_handlers()
    if app.frontend_name == 'widgets':
        app.donate_manager = donate.DonateManager()
    else:
        logging.warn("frontend is %s, not starting DonateManager()",
                     app.frontend_name)

    logging.info("Starting auto downloader...")
    autodler.start_downloader()
    app.icon_cache_updater.start_updates()
    yield None
    feed.expire_items()
    yield None
    commandline.startup()
    yield None
    autoupdate.check_for_updates()
    yield None
    app.local_metadata_manager.schedule_retry_net_lookup()
    # Delay running high CPU/IO operations for a bit
    eventloop.add_timeout(5, app.download_state_manager.startup_downloader,
            "start downloader daemon")
    eventloop.add_timeout(10, workerprocess.startup,
            "start worker process")
    eventloop.add_timeout(20, item.start_deleted_checker,
            "start checking deleted items")
    eventloop.add_timeout(30, feed.start_updates, "start feed updates")
    eventloop.add_timeout(60, item.update_incomplete_metadata,
            "update metadata data")
    eventloop.add_timeout(90, clear_icon_cache_orphans, "clear orphans")