Skip to content

Commit e135b95

Browse files
author
Yang Guo
committed
handle TaskRejectedException for spring thread task executor
1 parent 573d70d commit e135b95

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/node/YmlServiceImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import java.util.concurrent.TimeUnit;
5050
import java.util.function.Consumer;
5151
import org.springframework.beans.factory.annotation.Autowired;
52+
import org.springframework.core.task.TaskRejectedException;
5253
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
5354
import org.springframework.stereotype.Service;
5455

@@ -163,7 +164,7 @@ public Node loadYmlContent(final Node root, final Consumer<Yml> onSuccess, final
163164

164165
// async to load yml file
165166
executor.execute(new UpdateNodeYmlTask(root, nodeService, gitService, onSuccess, onError));
166-
} catch (ExecutionException e) {
167+
} catch (ExecutionException | TaskRejectedException e) {
167168
LOGGER.warn("Fail to get task executor for node: " + root.getPath());
168169
nodeService.updateYmlState(root, YmlStatusValue.ERROR, e.getMessage());
169170
}

0 commit comments

Comments
 (0)