Fix render cache clearing deleting the database instead of removing the cache data

This commit is contained in:
James Seibel
2023-10-08 21:17:35 -05:00
parent 9caad6ee41
commit 83999fd516
2 changed files with 6 additions and 13 deletions
@@ -317,21 +317,11 @@ public class RenderSourceFileHandler implements IRenderSourceProvider
public void deleteRenderCache()
{
// delete each file in the cache directory
File[] renderFiles = this.saveDir.listFiles();
if (renderFiles != null)
{
for (File renderFile : renderFiles)
{
if (!renderFile.delete())
{
LOGGER.warn("Unable to delete render file: " + renderFile.getPath());
}
}
}
// clear the cached files
this.loadedMetaFileBySectionPos.clear();
// delete the render cache
this.renderDataRepo.deleteAll();
}
@@ -155,6 +155,9 @@ public abstract class AbstractDhRepo<TDTO extends IBaseDTO>
this.queryDictionaryFirst("DELETE FROM "+this.getTableName()+" WHERE "+whereEqualStatement);
}
/** With great power comes great responsibility... */
public void deleteAll() { this.queryDictionaryFirst("DELETE FROM "+this.getTableName()); }
public boolean exists(TDTO dto) { return this.existsWithPrimaryKey(dto.getPrimaryKeyString()); }
public boolean existsWithPrimaryKey(String primaryKey)