Skip to content

Commit

Permalink
Merge pull request #497 from wri/gtc-2708
Browse files Browse the repository at this point in the history
GTC-2708 Expire all tile cache files when deleting a dataset version
  • Loading branch information
danscales authored Apr 19, 2024
2 parents 4a0ecd4 + 24c3834 commit 9e70a54
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/tasks/delete_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
async def delete_all_assets(dataset: str, version: str) -> None:
await delete_database_table_asset(dataset, version)
delete_s3_objects(DATA_LAKE_BUCKET, f"{dataset}/{version}/")
# expire_s3_objects(TILE_CACHE_BUCKET, f"{dataset}/{version}/")
expire_s3_objects(TILE_CACHE_BUCKET, f"{dataset}/{version}/")
flush_cloudfront_cache(TILE_CACHE_CLOUDFRONT_ID, [f"/{dataset}/{version}/*"])


Expand Down
2 changes: 2 additions & 0 deletions tests_v2/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ async def create_vector_source_version(
monkeypatch.setattr(batch, "submit_batch_job", batch_job_mock.submit_batch_job)
monkeypatch.setattr(vector_source_assets, "is_zipped", bool_function_closure(False))
monkeypatch.setattr(delete_assets, "delete_s3_objects", int_function_closure(1))
monkeypatch.setattr(delete_assets, "expire_s3_objects", dict_function_closure({}))
monkeypatch.setattr(versions, "flush_cloudfront_cache", dict_function_closure({}))
monkeypatch.setattr(
delete_assets, "flush_cloudfront_cache", dict_function_closure({})
Expand Down Expand Up @@ -248,6 +249,7 @@ async def generic_raster_version(
monkeypatch.setattr(versions, "_verify_source_file_access", void_coroutine)
monkeypatch.setattr(batch, "submit_batch_job", batch_job_mock.submit_batch_job)
monkeypatch.setattr(delete_assets, "delete_s3_objects", int_function_closure(1))
monkeypatch.setattr(delete_assets, "expire_s3_objects", dict_function_closure({}))
monkeypatch.setattr(raster_tile_set_assets, "get_extent", get_extent_mocked)
monkeypatch.setattr(
delete_assets, "flush_cloudfront_cache", dict_function_closure({})
Expand Down

0 comments on commit 9e70a54

Please sign in to comment.