Add batch methods to Sonador resource cache to remove entries that are no longer in the database
For medical imaging servers where studies and series are removed, there is a risk that the cache may fall out of sync from the resources table. When that happens, cache based queries will return resources no longer stored in the server. To prevent this from happening, there should be batch scripts which run on a regular interval (every ten minutes?) which compare the count of records in the resource cache to the the number in the resource table.
Actions:
- Query the number of records in the cache and in the resources table
- If there is a mismatch, retrieve UIDs of all resources of a particular type
- Compare left (resources table) to right (cache)
- If a resource is missing from the cache: create it
- If a resource is present in the cache, but not present in the table: remove it
- Compare left (resources table) to right (cache)
Edited by Rob Oakes