Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- minimum_check_threshold = 5 # How many entities are not found in a row before the expensive lookup is triggered
- while True:
- checked_entity_types = set()
- for entity_type, entities in build_queue.items():
- not_found_count = 0
- for entity in entities:
- try:
- request_construction(entity)
- except NoEntityFoundError:
- not_found_count += 1
- if not_found_count > minimum_check_threshold and entity_type not in checked_entity_types:
- if not check_entity_availability(entity_type): # Query against every logistic network
- break
- checked_entity_types.add(entity_type)
- else:
- not_found_count = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement