Skip to content

Commit

Permalink
move commit outside the internal look
Browse files Browse the repository at this point in the history
  • Loading branch information
tcezard committed Jun 17, 2024
1 parent e67f774 commit 517b644
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions eva-usage-stats/ws_query_fill_in_location.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def main():
logger.info("Job ran at " + str(datetime.datetime.now()))

postgres_conn_handle = get_metadata_connection_handle("production_processing", args.private_config_xml_file)
chunk_size = 1000
chunk_size = 100
update_query = (
'UPDATE eva_web_srvc_stats.ws_traffic SET client_country_code=%s, client_country_name=%s, '
'client_city=%s, client_postal=%s, client_latitude=%s, client_longitude=%s, client_state=%s '
Expand Down Expand Up @@ -75,9 +75,9 @@ def main():
logger.info(f'Updated {updated_row_count} record for {ip_address}')
nb_ip += 1
nb_row_updated += updated_row_count
# commit the changes to the database
logger.info(f'Committed {nb_row_updated} record for {nb_ip} IP addresses')
postgres_conn_handle.commit()
# commit the changes to the database
logger.info(f'Committed {nb_row_updated} record for {nb_ip} IP addresses')
postgres_conn_handle.commit()
logger.info(f'Updated {nb_row_updated} record for {nb_ip} IP addresses')


Expand Down

0 comments on commit 517b644

Please sign in to comment.