def _submit_filtering_jobs(self, uuid):
    '\n        Here we create the task and put it on the job queue.\n        '
    two_weeks_ago = (datetime.date.today() - datetime.timedelta(14))
    params = {'from': int(two_weeks_ago.strftime('%s')), 'to': int(time.time()), 'unit': 'seconds'}
    location_api_resp = requests.get(f'http://location-api:5000/geohashRegionsForUser/{uuid}', params=params)
    if (location_api_resp.status_code != 200):
        logger.warning(location_api_resp)
        api.abort(500, 'There was a problem when requesting data from the Location API')
    visited_regions_geohash_prefixes = location_api_resp.json()
    logger.info(f'Visited Regions for diagonzed patient: {str(visited_regions_geohash_prefixes)}')
    location_api_resp_users = requests.get('http://location-api:5000/users')
    if (location_api_resp_users.status_code != 200):
        logger.warning(location_api_resp_users)
        api.abort(500, 'There was a problem when requesting data from the Location API')
    all_influx_users = list((set(location_api_resp_users.json()) - {str(uuid)}))
    logger.info(f'All Influx users without diagnozed patient: {str(all_influx_users)}')
    n_workers = 3
    task_size = (len(all_influx_users) // n_workers)
    all_influx_users_partitioned = SingleUser._chunks(all_influx_users, task_size)
    redis_instance = redis.Redis(host=os.getenv('REDIS_HOST', 'queue'), port=os.getenv('REDIS_PORT', 6379), db=os.getenv('REDIS_DB_ID', 0))
    redis_namespace = os.getenv('REDIS_NAMESPACE', 'worker')
    redis_collection = os.getenv('REDIS_COLLECTION', 'jobs')
    logger.info(f'Connected with Redis ({redis_namespace}:{redis_collection})')
    for (idx, users_batch) in enumerate(all_influx_users_partitioned):
        job = {'type': 'scan_users_locations', 'args': {'user_id_range': users_batch, 'diagnozed_uuid': uuid, 'diagnozed_visited_regions': visited_regions_geohash_prefixes}}
        redis_instance.rpush(f'{redis_namespace}:{redis_collection}', json.dumps(job))
        logger.info(f'''Successfully pushed job #{idx} to the Job Queue:
{json.dumps(job)}''')
    logger.info('Finished pushing jobs to the Queue.')
Here we create the task and put it on the job queue.
def _submit_filtering_jobs(self, uuid):
    '\n        \n        '
    two_weeks_ago = (datetime.date.today() - datetime.timedelta(14))
    params = {'from': int(two_weeks_ago.strftime('%s')), 'to': int(time.time()), 'unit': 'seconds'}
    location_api_resp = requests.get(f'http://location-api:5000/geohashRegionsForUser/{uuid}', params=params)
    if (location_api_resp.status_code != 200):
        logger.warning(location_api_resp)
        api.abort(500, 'There was a problem when requesting data from the Location API')
    visited_regions_geohash_prefixes = location_api_resp.json()
    logger.info(f'Visited Regions for diagonzed patient: {str(visited_regions_geohash_prefixes)}')
    location_api_resp_users = requests.get('http://location-api:5000/users')
    if (location_api_resp_users.status_code != 200):
        logger.warning(location_api_resp_users)
        api.abort(500, 'There was a problem when requesting data from the Location API')
    all_influx_users = list((set(location_api_resp_users.json()) - {str(uuid)}))
    logger.info(f'All Influx users without diagnozed patient: {str(all_influx_users)}')
    n_workers = 3
    task_size = (len(all_influx_users) // n_workers)
    all_influx_users_partitioned = SingleUser._chunks(all_influx_users, task_size)
    redis_instance = redis.Redis(host=os.getenv('REDIS_HOST', 'queue'), port=os.getenv('REDIS_PORT', 6379), db=os.getenv('REDIS_DB_ID', 0))
    redis_namespace = os.getenv('REDIS_NAMESPACE', 'worker')
    redis_collection = os.getenv('REDIS_COLLECTION', 'jobs')
    logger.info(f'Connected with Redis ({redis_namespace}:{redis_collection})')
    for (idx, users_batch) in enumerate(all_influx_users_partitioned):
        job = {'type': 'scan_users_locations', 'args': {'user_id_range': users_batch, 'diagnozed_uuid': uuid, 'diagnozed_visited_regions': visited_regions_geohash_prefixes}}
        redis_instance.rpush(f'{redis_namespace}:{redis_collection}', json.dumps(job))
        logger.info(f'Successfully pushed job #{idx} to the Job Queue:
{json.dumps(job)}')
    logger.info('Finished pushing jobs to the Queue.')