forked from Qortal/qortal
Don't attempt to cleanup the filesystem if a build is in progress.
This isn't essential but it helps to reduce unnecessary load and processing which would be better spent on building.
This commit is contained in:
parent
b2c0915a71
commit
fd795b4361
@ -129,12 +129,13 @@ public class ArbitraryDataReader {
|
||||
}
|
||||
|
||||
private void preExecute() {
|
||||
ArbitraryDataManager.getInstance().setBuildInProgress(true);
|
||||
this.createWorkingDirectory();
|
||||
this.createUncompressedDirectory();
|
||||
}
|
||||
|
||||
private void postExecute() {
|
||||
|
||||
ArbitraryDataManager.getInstance().setBuildInProgress(false);
|
||||
}
|
||||
|
||||
private void createWorkingDirectory() {
|
||||
|
@ -106,6 +106,11 @@ public class ArbitraryDataCleanupManager extends Thread {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Don't interfere with the filesystem whilst a build is in progress
|
||||
if (ArbitraryDataManager.getInstance().getBuildInProgress()) {
|
||||
Thread.sleep(5000);
|
||||
}
|
||||
|
||||
// Fetch the transaction data
|
||||
ArbitraryTransactionData arbitraryTransactionData = ArbitraryTransactionUtils.fetchTransactionData(repository, signature);
|
||||
|
||||
|
@ -36,6 +36,8 @@ public class ArbitraryDataManager extends Thread {
|
||||
|
||||
private static ArbitraryDataManager instance;
|
||||
|
||||
private boolean buildInProgress = false;
|
||||
|
||||
private volatile boolean isStopping = false;
|
||||
|
||||
|
||||
@ -411,6 +413,15 @@ public class ArbitraryDataManager extends Thread {
|
||||
}
|
||||
|
||||
|
||||
public void setBuildInProgress(boolean buildInProgress) {
|
||||
this.buildInProgress = buildInProgress;
|
||||
}
|
||||
|
||||
public boolean getBuildInProgress() {
|
||||
return this.buildInProgress;
|
||||
}
|
||||
|
||||
|
||||
// Network handlers
|
||||
|
||||
public void onNetworkGetArbitraryDataMessage(Peer peer, Message message) {
|
||||
|
Loading…
Reference in New Issue
Block a user