Skip to content

Commit 0eaf9d3

Browse files
author
yang.guo
authored
Merge pull request #137 from FlowCI/feature/api/transaction_serilizer
创建Job的事务设置串行保证一致性
2 parents 74bbbd6 + a6b81f7 commit 0eaf9d3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

platform-api/src/main/java/com/flow/platform/api/service/job/JobServiceImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
import org.springframework.beans.factory.annotation.Value;
7979
import org.springframework.scheduling.annotation.Scheduled;
8080
import org.springframework.stereotype.Service;
81+
import org.springframework.transaction.annotation.Isolation;
8182
import org.springframework.transaction.annotation.Transactional;
8283

8384
/**
@@ -167,7 +168,7 @@ public List<Job> list(List<String> paths, boolean latestOnly) {
167168
}
168169

169170
@Override
170-
@Transactional(noRollbackFor = FlowException.class)
171+
@Transactional(noRollbackFor = FlowException.class, isolation = Isolation.SERIALIZABLE)
171172
public Job createFromFlowYml(String path, JobCategory eventType, Map<String, String> envs, User creator) {
172173
// verify flow yml status
173174
Node flow = nodeService.find(path).root();

0 commit comments

Comments
 (0)