Пример #1
0
def threaded_heartbeat():
    """
    Fires off a threaded task to check in with feederd via SimpleDB_. There
    is a domain that contains all of the running EC2_ instances and their
    unique IDs, along with some state data.
    
    The interval at which heartbeats occur is determined by the
    :py:data:`NOMMERD_HEARTBEAT_INTERVAL <media_nommer.conf.settings.NOMMERD_HEARTBEAT_INTERVAL` 
    setting.
    """
    if settings.NOMMERD_TERMINATE_WHEN_IDLE:
        # thread_count_mod factors out this thread when counting active threads.
        is_terminated = NodeStateManager.contemplate_termination(thread_count_mod= -1)
    else:
        is_terminated = False

    if not is_terminated:
        NodeStateManager.send_instance_state_update()