PASTAplus / dex

Explore and subset CSV tables using associated EML metadata
Apache License 2.0
3 stars 0 forks source link

Add REST endpoint to flush cache for a single data package #69

Closed rogerdahl closed 3 weeks ago

rogerdahl commented 8 months ago

The endpoint will be called by PASTA as a step in permanently deleting a package from the system.

The endpoint will take a PackageID and will flush cache entries for any and all entities in that package.

If no entities for the package have been opened in DeX, meaning DeX has no knowledge of the PackageID, we still consider the operation valid. So as long as a PackageId on valid form (e.g., knb-lter-ble.9.1 is passed in, we will return 200 OK. Otherwise, we will return a 400 Bad Request.

If a call to this API is made maliciously, it just causes a caches to be automatically rebuilt the next time they're needed, so we don't have to secure it.

servilla commented 3 months ago

This API method should also remove the entry in the /tmp/dex-tmp-cache since it recreates a partially functioning view of the data table.