A few months back we had a consultant write a python script that takes a layer in SDE and updates an AGOL layer. It replaces all of the records every 12 hours.
I've noticed that since this script went live, our ESRI credit usage has been climbing each month significantly. At the same time, the size of the AGOL layer the script writes to is growing in size.
Has anyone had this same issue and is there a way to remedy it? Thank you.
What are the settings on the layer? If you have the setting turned on to "track changes" (not editor tracking), that may be causing the increased storage.
Hey Josh, thanks for the reply. Right now the only setting we have on in the layer is 'Enable Sync' because it is needed for offline use.
Here is the actual code being run if it helps.
portal = AGOL_URL
user = AGOL_USER
password = AGOL_PASSWORD
item_id = AGOL_ITEM_ID
gis = arcgis.GIS(portal, user, password)
item = gis.content.get(item_id)
table_to_update = item.layers[0]
new_features = gather_features(poetaxlots_fc)
truncate(table_to_update, log_file_path)
process_rows(new_features, table_to_update, log_file_path)
email_message += "\n\nAGOL hosted feature layer overwritten successfully"
send_email(email_message, start_time)
except Exception as e:
handle_error(e, start_time, log_file_path)
finally:
write_to_log_file(log_file_path, email_message)
Also random question... it uses Truncate, which has archiving as an option...but how would I disable that in an AGOL layer? Does arcpy.management.DisableArchiving work on AGOL layers?
what is the current size of the data and how much data is being added every12 hours? Using truncate should not be an issue.