def filter_func_consecutive_resources(current_time, job, min_entries,
    max_entries, current_result, current_remaining, r):
    """`filter_func` function to only add resources which are neighbours of already
    added resources (e.g. `[10, 11, 12]`, but not `[10, 11, 13]`)
    """
    if not current_result:
        return True
    last_id = current_result[-1].id
    return r.id == last_id + 1 or r.id == last_id - 1
