I'm writing a script to export some feature services in AGOL to FGDB and then download them.
The export process takes a while but my code doesn't pause execution despite using wait='True'. This results in a corrupted zip file as my code downloads it before the export has finished.
Since gis.item.export returns a jobid I would think I could poll the job status until it is success however I don't see a rest endpoint to do this. I've tried things like https://services1.arcgis.com/myorg/ArcGIS/rest/services/myFS/jobs/<jobid> but I don't see any status messages.
As of right now I am putting in an arbitrary 3 minute wait timer but I would like something a little less hacky.
mygis = GIS(username="myuser",password="*****")
service = mygis.content.get(itemID)
itemDes = service.export(title="DamageReports", export_format= 'File Geodatabase', parameters=None, wait='True')
fgdb = mygis.content.get(itemDes['exportItemId'])
<wait time goes here>
fgdb.download(r"D:\temp")