fixed ui
This commit is contained in:
parent
dc1be1e9b0
commit
b4d997efd4
|
@ -273,7 +273,11 @@ export class WfHistoryClient extends ISClient {
|
|||
return;
|
||||
}
|
||||
|
||||
this.httpGet(url, onSuccess);
|
||||
if (mode == 4) {
|
||||
this.httpGet(url, (job: WfHistoryEntry) => onSuccess([job]));
|
||||
} else {
|
||||
this.httpGet(url, onSuccess);
|
||||
}
|
||||
}
|
||||
|
||||
findProcess(id: string, onSuccess: Function) {
|
||||
|
|
|
@ -57,4 +57,12 @@ public class MDStoreManagerClient extends DnetServiceClient {
|
|||
public MDStoreVersion endReading(final MDStoreVersion version) {
|
||||
return httpGet("/api/mdstores/version/{versionId}/endReading", MDStoreVersion.class, Map.of("versionId", version.getId()));
|
||||
}
|
||||
|
||||
public boolean existsMdSstore(final String mdId) {
|
||||
try {
|
||||
return findMDStore(mdId) != null;
|
||||
} catch (final Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,8 +2,8 @@ package eu.dnetlib.wfs.nodes.store;
|
|||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import eu.dnetlib.common.clients.MDStoreManagerClient;
|
||||
import eu.dnetlib.common.clients.DnetServiceClientFactory;
|
||||
import eu.dnetlib.common.clients.MDStoreManagerClient;
|
||||
import eu.dnetlib.wfs.annotations.WfInputParam;
|
||||
import eu.dnetlib.wfs.annotations.WfNode;
|
||||
import eu.dnetlib.wfs.nodes.ProcessNode;
|
||||
|
@ -19,7 +19,11 @@ public class DeleteMdStoreNode extends ProcessNode {
|
|||
|
||||
@Override
|
||||
protected void execute() throws Exception {
|
||||
clientFactory.getClient(MDStoreManagerClient.class).deleteMdStore(mdId);
|
||||
final MDStoreManagerClient client = this.clientFactory.getClient(MDStoreManagerClient.class);
|
||||
|
||||
if (client.existsMdSstore(this.mdId)) {
|
||||
client.deleteMdStore(this.mdId);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -10,9 +10,9 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
|
@ -76,7 +76,7 @@ public class ProcessEngine {
|
|||
|
||||
private final Set<String> validNodeTypes = new HashSet<>();
|
||||
|
||||
private final ExecutorService wfsThreadPool = Executors.newFixedThreadPool(MAX_RUNNING_WFS);
|
||||
private final ThreadPoolExecutor wfsThreadPool = (ThreadPoolExecutor) Executors.newFixedThreadPool(MAX_RUNNING_WFS);
|
||||
|
||||
@Value("${dnet.wf.procs.size:20}")
|
||||
private int maxSize;
|
||||
|
@ -153,7 +153,7 @@ public class ProcessEngine {
|
|||
while (true) {
|
||||
try {
|
||||
final String processId = this.queue.take();
|
||||
if (tryToAccept(processId, ServiceStatusRegistry.getStatus().getName())) {
|
||||
if ((this.wfsThreadPool.getActiveCount() < MAX_RUNNING_WFS) && tryToAccept(processId, ServiceStatusRegistry.getStatus().getName())) {
|
||||
this.wfsThreadPool.execute(() -> startWorkflowJob(this.jobRepository.findById(processId).get()));
|
||||
}
|
||||
} catch (final Throwable e) {
|
||||
|
|
Loading…
Reference in New Issue