Esempio n. 1
0
def start_fetcher(options):
    global kcd_db_conn
 
    # Connect to the kas postgres database on kcd host.
    logger.info("Connecting to the kcd database.")
    try:
        kcd_db_conn = get_kcd_db_conn(get_kcd_external_conf_object())
    except:
        logger.error("Could not connect to the kcd database.")
        raise
    logger.debug("Connected to the kcd database.")
    
    # Enable keepalives to detect failed connections before 2 hours pass.
    enable_keepalive()
    
    # Listen to the list of workspaces.
    logger.info("Listening to the list of workspaces.")
    listen_kws_list()
    
    # Enter the main loop.
    logger.info("Entering the main loop.")
    do_main_loop()
Esempio n. 2
0
def start_fetcher(options):
    global kcd_db_conn

    # Connect to the kas postgres database on kcd host.
    logger.info("Connecting to the kcd database.")
    try:
        kcd_db_conn = get_kcd_db_conn(get_kcd_external_conf_object())
    except:
        logger.error("Could not connect to the kcd database.")
        raise
    logger.debug("Connected to the kcd database.")

    # Enable keepalives to detect failed connections before 2 hours pass.
    enable_keepalive()

    # Listen to the list of workspaces.
    logger.info("Listening to the list of workspaces.")
    listen_kws_list()

    # Enter the main loop.
    logger.info("Entering the main loop.")
    do_main_loop()
Esempio n. 3
0
 def db_connect(self):
     if not self.db_conn: self.db_conn = get_kcd_db_conn(self.conf)