Skip to content

Commit 5cd09b4

Browse files
authored
[Fix-17297][YARN-QUEUE-MANAGE]Fix creation time should not be changed when modifying data (#17298)
1 parent ce7440d commit 5cd09b4

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/QueueServiceImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ public Queue updateQueue(User loginUser, int id, String queue, String queueName)
192192
}
193193

194194
Queue updateQueue = new Queue(id, queueName, queue);
195+
updateQueue.setCreateTime(null);
195196
Queue existsQueue = queueMapper.selectById(id);
196197
updateQueueValid(existsQueue, updateQueue);
197198

dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/QueueServiceTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ public void testUpdateQueue() {
186186
// success
187187
when(userMapper.existUser(Mockito.anyString())).thenReturn(false);
188188
assertDoesNotThrow(() -> queueService.updateQueue(getLoginUser(), 1, NOT_EXISTS, NOT_EXISTS));
189+
Queue queue = queueService.updateQueue(getLoginUser(), 1, NOT_EXISTS, NOT_EXISTS);
190+
Assertions.assertNull(queue.getCreateTime());
189191

190192
// success update with same queue name
191193
when(queueMapper.existQueue(NOT_EXISTS_FINAL, null)).thenReturn(false);

0 commit comments

Comments
 (0)