Fix for Impexium API import adjustments

This commit is contained in:
2023-04-19 17:07:01 -04:00
parent 90ab23b356
commit 0ad9a0f56f
2 changed files with 6 additions and 5 deletions

View File

@@ -297,7 +297,7 @@ def create_update_event_badge_obj_v4(
log.info(f'Event Person ID: {event_person_id}') log.info(f'Event Person ID: {event_person_id}')
return False return False
log.info('Create dictionary or Pydantic object') log.debug('Create dictionary or Pydantic object')
log.debug(type(event_badge_dict_obj)) log.debug(type(event_badge_dict_obj))
if isinstance(event_badge_dict_obj, dict): if isinstance(event_badge_dict_obj, dict):
event_badge_dict = event_badge_dict_obj event_badge_dict = event_badge_dict_obj

View File

@@ -66,16 +66,17 @@ async def event_import_reg(
# BEGIN: Loop through the registrants pulled from Impexium # BEGIN: Loop through the registrants pulled from Impexium
loop_count = 0 loop_count = 0
loop_limit = 2500 # 200 loop_limit = 4500 # 200
event_person_li = [] event_person_li = []
event_person_summary_li = [] event_person_summary_li = []
for event_registrant in event_registrant_li: for event_registrant in event_registrant_li:
if loop_count > loop_limit: break if loop_count > loop_limit: break
# if rand
# log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL # log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
rand_number = random.choices(['HEADS', 'TAILS'], [4, 6])[0] # 70% chance to process this record! rand_number = None
log.debug(f'Random Number: {rand_number}') if len(event_registrant_li) > 1500:
rand_number = random.choices(['HEADS', 'TAILS'], [4, 6])[0] # 70% chance to process this record!
log.debug(f'Random Number: {rand_number}')
if rand_number == 'HEADS': if rand_number == 'HEADS':
log.info('Skipping this record this time run.') log.info('Skipping this record this time run.')
continue continue