Some records will be randomly skipped

This commit is contained in:
2023-04-19 01:16:33 -04:00
parent 0317201406
commit 90ab23b356

View File

@@ -73,12 +73,13 @@ async def event_import_reg(
if loop_count > loop_limit: break if loop_count > loop_limit: break
# if rand # 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'], [3, 7])[0] # 70% chance to process this record! rand_number = random.choices(['HEADS', 'TAILS'], [4, 6])[0] # 70% chance to process this record!
log.debug(f'Random Number: {rand_number}') log.debug(f'Random Number: {rand_number}')
if rand_number == 'HEADS': if rand_number == 'HEADS':
log.info('Skipping this record this time run.')
continue continue
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL # log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.warning(f'BEGIN: **** *** ** * Impexium registrant import loop #{loop_count} * ** *** ****') log.warning(f'BEGIN: **** *** ** * Impexium registrant import loop #{loop_count} * ** *** ****')
# ISHLT 2022 used event_registrant.get('registrantTypeCode') for the registration type # ISHLT 2022 used event_registrant.get('registrantTypeCode') for the registration type
@@ -600,8 +601,12 @@ async def event_import_reg(
event_badge_id = event_person_result.get('event_badge_id') event_badge_id = event_person_result.get('event_badge_id')
event_person_profile_id = event_person_result.get('event_person_profile_id') event_person_profile_id = event_person_result.get('event_person_profile_id')
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
# event_person_data.pop('allow_tracking') # Leave this alone as a backup reference? # event_person_data.pop('allow_tracking') # Leave this alone as a backup reference?
# event_person_data['event_badge'].pop('allow_tracking') # We do not want to override their onsite selection # log.debug('Allow Tracking:')
log.debug(event_person_data['event_badge'].get('allow_tracking', 'allow_tracking NOT FOUND'))
event_person_data['event_badge'].pop('allow_tracking') # We do not want to override their onsite selection
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.info(f'Found Event Person. Updating existing... Event Person ID: {event_person_id}') log.info(f'Found Event Person. Updating existing... Event Person ID: {event_person_id}')
if create_event_person_obj_result := create_update_event_person_obj_v4( if create_event_person_obj_result := create_update_event_person_obj_v4(