Improved delete performance
This commit is contained in:
parent
3753f0baf9
commit
1c06edb5b1
|
@ -30,18 +30,20 @@ public class GRSFResource extends CKANResource {
|
|||
deleteStorageResource(url, filename, mimeType);
|
||||
} catch(Exception e) {
|
||||
logger.error("Unable to delete resource {}",
|
||||
previousRepresentation != null ? getAsString(previousRepresentation) : "");
|
||||
previousRepresentation != null ? getAsString(previousRepresentation) : "", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void deleteStorageResource(URL url, String filename, String mimetype) {
|
||||
persistedURL = url;
|
||||
if(isStorageFile(persistedURL)) {
|
||||
URL finalURL = getFinalURL(url);
|
||||
if(isStorageFile(finalURL)) {
|
||||
try {
|
||||
String storageFilename = Record.getFilename(name, filename);
|
||||
// String storageFilename = Record.getFilename(name, filename);
|
||||
((GRSFStorageHubManagement) storageHubManagement).setGrsfUUID(name);
|
||||
storageHubManagement.deleteResourcePersistence(itemID, storageFilename, mimetype);
|
||||
// storageHubManagement.deleteResourcePersistence(itemID, storageFilename, mimetype);
|
||||
storageHubManagement.deleteResourcePersistence(finalURL, itemID);
|
||||
} catch(Exception e) {
|
||||
throw new InternalServerErrorException(e);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue