This is an automated email from the ASF dual-hosted git repository.

lidongdai pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/seatunnel-web.git


The following commit(s) were added to refs/heads/main by this push:
     new 8d0c436e [Hotfix][APP] Fix job config file generation path error in 
windows (#140)
8d0c436e is described below

commit 8d0c436e4fbcae90c5b3f3b5f7d88104766635b1
Author: dbac <[email protected]>
AuthorDate: Sat Oct 28 00:24:51 2023 +0800

    [Hotfix][APP] Fix job config file generation path error in windows (#140)
    
    * [fit][seatunnel-app]
          Modify configuration file generation path rules to adapt to windows 
and linux
    
    * [refactor][APP]
          Modify exception logs
---
 .../app/service/impl/JobExecutorServiceImpl.java          | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git 
a/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/service/impl/JobExecutorServiceImpl.java
 
b/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/service/impl/JobExecutorServiceImpl.java
index 145e25a9..947519f1 100644
--- 
a/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/service/impl/JobExecutorServiceImpl.java
+++ 
b/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/service/impl/JobExecutorServiceImpl.java
@@ -29,6 +29,7 @@ import 
org.apache.seatunnel.app.thirdparty.metrics.EngineMetricsExtractorFactory
 import org.apache.seatunnel.app.thirdparty.metrics.IEngineMetricsExtractor;
 import org.apache.seatunnel.common.config.Common;
 import org.apache.seatunnel.common.config.DeployMode;
+import org.apache.seatunnel.common.utils.ExceptionUtils;
 import org.apache.seatunnel.engine.client.SeaTunnelClient;
 import org.apache.seatunnel.engine.client.job.ClientJobProxy;
 import org.apache.seatunnel.engine.client.job.JobExecutionEnvironment;
@@ -76,7 +77,8 @@ public class JobExecutorServiceImpl implements 
IJobExecutorService {
 
     public String writeJobConfigIntoConfFile(String jobConfig, Long 
jobDefineId) {
         String projectRoot = System.getProperty("user.dir");
-        String filePath = projectRoot + "\\profile\\" + jobDefineId + ".conf";
+        String filePath =
+                projectRoot + File.separator + "profile" + File.separator + 
jobDefineId + ".conf";
         try {
             File file = new File(filePath);
             if (!file.exists()) {
@@ -120,6 +122,7 @@ public class JobExecutorServiceImpl implements 
IJobExecutorService {
                     });
 
         } catch (ExecutionException | InterruptedException e) {
+            ExceptionUtils.getMessage(e);
             throw new RuntimeException(e);
         }
         return jobInstanceId;
@@ -189,8 +192,14 @@ public class JobExecutorServiceImpl implements 
IJobExecutorService {
         JobInstance jobInstance = jobInstanceDao.getJobInstance(jobInstanceId);
 
         String projectRoot = System.getProperty("user.dir");
-        String filePath = projectRoot + "\\profile\\" + 
jobInstance.getJobDefineId() + ".conf";
-
+        String filePath =
+                projectRoot
+                        + File.separator
+                        + "profile"
+                        + File.separator
+                        + jobInstance.getJobDefineId()
+                        + ".conf";
+        log.info("jobStore filePath:{}", filePath);
         SeaTunnelEngineProxy.getInstance()
                 .restoreJob(filePath, jobInstanceId, 
Long.valueOf(jobInstance.getJobEngineId()));
         return Result.success();

Reply via email to