pyca/agentstate.py
def control_loop():
    '''Main loop, updating the capture agent state.
    '''
    set_service_status(Service.AGENTSTATE, ServiceStatus.BUSY)
    notify.notify('READY=1')
    notify.notify('STATUS=Running')
    while not terminate():
        notify.notify('WATCHDOG=1')
        update_agent_state()

        next_update = timestamp() + config()['agent']['update_frequency']
        while not terminate() and timestamp() < next_update:
            time.sleep(0.1)

    logger.info('Shutting down agentstate service')
    set_service_status(Service.AGENTSTATE, ServiceStatus.STOPPED)
def control_loop():
    '''Main loop, updating the capture agent state.
    '''
    set_service_status(Service.AGENTSTATE, ServiceStatus.BUSY)
    notify.notify('READY=1')
    notify.notify('STATUS=Running')
    while not terminate():
        notify.notify('WATCHDOG=1')
        update_agent_state()

        next_update = timestamp() + config()['agent']['update_frequency']
        while not terminate() and timestamp() < next_update:
            time.sleep(0.1)

    logger.info('Shutting down agentstate service')
    set_service_status(Service.AGENTSTATE, ServiceStatus.STOPPED)
def control_loop ( ) : set_service_status ( Service . AGENTSTATE , ServiceStatus . BUSY ) notify . notify ( 'READY=1' ) notify . notify ( 'STATUS=Running' ) while not terminate ( ) : notify . notify ( 'WATCHDOG=1' ) update_agent_state ( ) next_update = timestamp ( ) + config ( ) [ 'agent' ] [ 'update_frequency' ] while not terminate ( ) and timestamp ( ) < next_update : time . sleep ( 0.1 ) logger . info ( 'Shutting down agentstate service' ) set_service_status ( Service . AGENTSTATE , ServiceStatus . STOPPED )
Main loop, updating the capture agent state.
Main loop updating the capture agent state .