def threaded_check_for_job_state_changes():
    """
    Checks the SQS queue specified in the
    :py:data:`SQS_JOB_STATE_CHANGE_QUEUE_NAME <media_nommer.conf.settings.SQS_JOB_STATE_CHANGE_QUEUE_NAME>`
    setting for announcements of state changes from the EC2_ instances running
    :doc:`../ec2nommerd`. This lets :doc:`../feederd` know it needs to get 
    updated job details from the SimpleDB_ domain defined in the
    :py:data:`SIMPLEDB_JOB_STATE_DOMAIN <media_nommer.conf.settings.SIMPLEDB_JOB_STATE_DOMAIN>`
    setting.
    """
    JobCache.refresh_jobs_with_state_changes()
    # If jobs have completed, remove them from the job cache.
    JobCache.uncache_finished_jobs()
def threaded_check_for_job_state_changes():
    """
    Checks the SQS queue specified in the
    :py:data:`SQS_JOB_STATE_CHANGE_QUEUE_NAME <media_nommer.conf.settings.SQS_JOB_STATE_CHANGE_QUEUE_NAME>`
    setting for announcements of state changes from the EC2_ instances running
    :doc:`../ec2nommerd`. This lets :doc:`../feederd` know it needs to get
    updated job details from the SimpleDB_ domain defined in the
    :py:data:`SIMPLEDB_JOB_STATE_DOMAIN <media_nommer.conf.settings.SIMPLEDB_JOB_STATE_DOMAIN>`
    setting.
    """
    changed_jobs = JobCache.refresh_jobs_with_state_changes()
    for job in changed_jobs:
        job_state_notifier.send_notification(job)
    # If jobs have completed, remove them from the job cache.
    JobCache.uncache_finished_jobs()