Select to view content in your preferred language

VectorTileLayer: rebuild_cache() works in browser, but not from Python API

87
0
a week ago
Labels (3)
KennethEggeringAtStantec
Emerging Contributor

Greetings ESRI-Community, 

Having an issue rebuilding vector-tile-layer caches through the Python API. I have been able to rebuild them through the browser without issue (see attached image), but it fails to work when using the following script despite Python returning a "success" message.

When I run the script, the success message happens instantly (I assume this is normal behavior but wanted to note it). When rebuilding through the browser, the spinning wheel takes about 20 minutes to complete, so I have tried waiting for over an hour to check if the Python update worked correctly.

Am I missing something in my code?

Thanks,

Ken

from arcgis.gis import GIS

gis = GIS("pro")

vector_tile_item = gis.content.get("7253ad761f424cec882e6dabcdefghij")
print(f"\tSearch returned: {vector_tile_item.title}, of type '{type(vector_tile_item)}'")
vector_tile_lyr0_manager = vector_tile_item.layers[0].manager
cache_rebuild = vector_tile_lyr0_manager.rebuild_cache()
print(f"Cache-Rebuild status: {cache_rebuild}")

# Prints --> Cache-Rebuild status: {'id': '0bb7112a-f705-4832-a7e7-a66e27216c83', 'name': 'Building Code20250725__1655', 'status': 'Success', 'itemId': '7253ad761f424cec882e6dabcdefghij', 'type': 'Map Service', 'jobId': '00000000-0000-0000-0000-000000000000', 'message': 'success'}

 

0 Kudos
0 Replies