Browse Source

Don't delete a resource's cache if a build is in progress.

Hopeful fix for "Unable to delete cache for resource: Unable to delete directory" error, and possibly some other file conflicts.
block-minter-updates
CalDescent 3 years ago
parent
commit
c4f763960c
  1. 7
      src/main/java/org/qortal/arbitrary/ArbitraryDataResource.java

7
src/main/java/org/qortal/arbitrary/ArbitraryDataResource.java

@ -128,6 +128,13 @@ public class ArbitraryDataResource {
} }
public void deleteCache() throws IOException { public void deleteCache() throws IOException {
// Don't delete anything if there's a build in progress
ArbitraryDataBuildQueueItem queueItem =
new ArbitraryDataBuildQueueItem(resourceId, resourceIdType, service, identifier);
if (ArbitraryDataBuildManager.getInstance().isInBuildQueue(queueItem)) {
return;
}
String baseDir = Settings.getInstance().getTempDataPath(); String baseDir = Settings.getInstance().getTempDataPath();
String identifier = this.identifier != null ? this.identifier : "default"; String identifier = this.identifier != null ? this.identifier : "default";
Path cachePath = Paths.get(baseDir, "reader", this.resourceIdType.toString(), this.resourceId, this.service.toString(), identifier); Path cachePath = Paths.get(baseDir, "reader", this.resourceIdType.toString(), this.resourceId, this.service.toString(), identifier);

Loading…
Cancel
Save