diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java index ee5a113fbc..4aab152552 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java @@ -96,7 +96,7 @@ public class TestPlanService { @Resource UserMapper userMapper; - public void addTestPlan(AddTestPlanRequest testPlan) { + public synchronized void addTestPlan(AddTestPlanRequest testPlan) { if (getTestPlanByName(testPlan.getName()).size() > 0) { MSException.throwException(Translator.get("plan_name_already_exists")); } @@ -141,7 +141,7 @@ public class TestPlanService { } } - public synchronized List getTestPlanByName(String name) { + public List getTestPlanByName(String name) { TestPlanExample example = new TestPlanExample(); example.createCriteria().andWorkspaceIdEqualTo(SessionUtils.getCurrentWorkspaceId()) .andNameEqualTo(name);