some fixes

This commit is contained in:
Michele Artini 2023-03-01 13:01:24 +01:00
parent 01b046cfb4
commit a3d8b0de4d
16 changed files with 31 additions and 25 deletions

View File

@ -20,7 +20,11 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
@Configuration
@EnableTransactionManagement
@EnableJpaRepositories(entityManagerFactoryRef = "mainEntityManagerFactory", transactionManagerRef = "mainTransactionManager", basePackages = {
"eu.dnetlib.is", "eu.dnetlib.data.mdstore", "eu.dnetlib.manager"
"eu.dnetlib.is",
"eu.dnetlib.common",
"eu.dnetlib.manager.history",
// "eu.dnetlib.manager.wf",
"eu.dnetlib.data.mdstore"
})
public class MainDBConfig {
@ -38,7 +42,9 @@ public class MainDBConfig {
@Qualifier("mainDataSource") final DataSource ds) {
return builder
.dataSource(ds)
.packages("eu.dnetlib.is.model", "eu.dnetlib.manager.wf.model", "eu.dnetlib.data.mdstore.model")
.packages("eu.dnetlib.is.model", "eu.dnetlib.manager.history.model", "eu.dnetlib.common.model",
// "eu.dnetlib.manager.wf.model",
"eu.dnetlib.data.mdstore.model")
.persistenceUnit("is")
.build();
}

View File

@ -21,7 +21,6 @@ public class ZeppelinAjaxController extends AbstractDnetController {
@GetMapping("/templates")
public List<String> getTemplates() throws MDStoreManagerException {
try {
// if (zeppelinClient.get)
return zeppelinClient.listTemplates();
} catch (final Throwable e) {
throw new MDStoreManagerException("Zeppelin is unreachable", e);

View File

@ -19,8 +19,8 @@ import org.springframework.stereotype.Service;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import eu.dnetlib.manager.wf.model.WfProcessExecution;
import eu.dnetlib.manager.wf.repository.WfProcessExecutionRepository;
import eu.dnetlib.manager.history.model.WfProcessExecution;
import eu.dnetlib.manager.history.repository.WfProcessExecutionRepository;
@Service
public class WfHistoryImporter {

View File

@ -9,7 +9,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import eu.dnetlib.manager.wf.model.WfProcessExecution;
import eu.dnetlib.manager.history.WorkflowLogger;
import eu.dnetlib.manager.history.model.WfProcessExecution;
@RestController
@RequestMapping("/ajax/wfs")

View File

@ -11,7 +11,7 @@ maven.pom.path = /META-INF/maven/eu.dnetlib.dhp/dnet-is-application/effective-po
spring.main.banner-mode = off
logging.level.root = INFO
logging.level.root = WARN
#logging.level.org.springframework = DEBUG
management.endpoints.web.exposure.include = prometheus,health

View File

@ -1,4 +1,4 @@
package eu.dnetlib.manager.wf.model;
package eu.dnetlib.common.model;
import java.io.Serializable;

View File

@ -1,4 +1,4 @@
package eu.dnetlib.manager.wf.model;
package eu.dnetlib.manager.history.model;
import java.io.Serializable;
import java.time.LocalDateTime;

View File

@ -1,8 +1,8 @@
package eu.dnetlib.manager.wf.repository;
package eu.dnetlib.common.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import eu.dnetlib.manager.wf.model.EmailTemplate;
import eu.dnetlib.common.model.EmailTemplate;
public interface EmailTemplateRepository extends JpaRepository<EmailTemplate, String> {

View File

@ -1,4 +1,4 @@
package eu.dnetlib.manager.wf;
package eu.dnetlib.manager.history;
import java.time.Instant;
import java.time.LocalDateTime;
@ -11,8 +11,8 @@ import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import eu.dnetlib.manager.wf.model.WfProcessExecution;
import eu.dnetlib.manager.wf.repository.WfProcessExecutionRepository;
import eu.dnetlib.manager.history.model.WfProcessExecution;
import eu.dnetlib.manager.history.repository.WfProcessExecutionRepository;
@Service
public class WorkflowLogger {

View File

@ -1,4 +1,4 @@
package eu.dnetlib.manager.wf.repository;
package eu.dnetlib.manager.history.repository;
import java.time.LocalDateTime;
import java.util.List;
@ -6,7 +6,7 @@ import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository;
import eu.dnetlib.manager.wf.model.WfProcessExecution;
import eu.dnetlib.manager.history.model.WfProcessExecution;
public interface WfProcessExecutionRepository extends JpaRepository<WfProcessExecution, String> {

View File

@ -25,7 +25,7 @@ import org.springframework.stereotype.Service;
import com.google.common.base.Splitter;
import eu.dnetlib.manager.wf.repository.EmailTemplateRepository;
import eu.dnetlib.common.repository.EmailTemplateRepository;
@Service
public class EmailDispatcher {

View File

@ -11,7 +11,7 @@ import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.scheduling.support.CronExpression;
import org.springframework.stereotype.Service;
import eu.dnetlib.manager.wf.WorkflowLogger;
import eu.dnetlib.manager.history.WorkflowLogger;
import eu.dnetlib.manager.wf.model.WorkflowInstance;
import eu.dnetlib.manager.wf.repository.WorkflowInstanceRepository;
import eu.dnetlib.manager.wf.workflows.procs.ProcessRegistry;

View File

@ -16,8 +16,8 @@ import org.springframework.stereotype.Service;
import com.google.common.base.Throwables;
import eu.dnetlib.manager.wf.WorkflowLogger;
import eu.dnetlib.manager.wf.model.WfProcessExecution;
import eu.dnetlib.manager.history.WorkflowLogger;
import eu.dnetlib.manager.history.model.WfProcessExecution;
import eu.dnetlib.manager.wf.nodes.ProcessNode;
import eu.dnetlib.manager.wf.notification.EmailSender;
import eu.dnetlib.manager.wf.workflows.graph.GraphNode;

View File

@ -5,6 +5,8 @@ import java.util.UUID;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import javax.annotation.PostConstruct;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -17,7 +19,6 @@ import eu.dnetlib.manager.wf.model.WorkflowDbEntry;
import eu.dnetlib.manager.wf.model.WorkflowInstance;
import eu.dnetlib.manager.wf.repository.WorkflowDbEntryRepository;
import eu.dnetlib.manager.wf.repository.WorkflowInstanceRepository;
import eu.dnetlib.manager.wf.workflows.graph.GraphLoader;
import eu.dnetlib.manager.wf.workflows.util.ProcessCallback;
import eu.dnetlib.manager.wf.workflows.util.WorkflowsConstants;
import eu.dnetlib.utils.Stoppable;
@ -28,8 +29,6 @@ public class WorkflowExecutor implements Stoppable {
private static final Log log = LogFactory.getLog(WorkflowExecutor.class);
@Autowired
private GraphLoader graphLoader;
@Autowired
private ProcessRegistry processRegistry;
@Autowired
@ -46,6 +45,7 @@ public class WorkflowExecutor implements Stoppable {
private boolean paused = false;
@PostConstruct
public void init() {
Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate(() -> {
if (isPaused() || processRegistry.countRunningWfs() >= WorkflowsConstants.MAX_RUNNING_PROCS_SIZE) { return; }

View File

@ -451,7 +451,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.plugin.version>3.9.0</maven.compiler.plugin.version>
<maven.compiler.plugin.version>3.11.0</maven.compiler.plugin.version>
<java.version>1.8</java.version>
<dhp-schemas-version>2.14.0</dhp-schemas-version>
<apache.solr.version>7.1.0</apache.solr.version>