From 0176f4bf61132d48eff13793bea92ffbb0e174ba Mon Sep 17 00:00:00 2001 From: caishunfeng Date: Mon, 25 Apr 2022 13:26:34 +0800 Subject: [PATCH] [Bug-9737][Api] fix task plugin load in api (#9744) * fix task plugin load in api * task plugin loading by event --- .../dolphinscheduler/api/ApiApplicationServer.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/ApiApplicationServer.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/ApiApplicationServer.java index 7981f8a48d..9e6aa94530 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/ApiApplicationServer.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/ApiApplicationServer.java @@ -17,18 +17,31 @@ package org.apache.dolphinscheduler.api; +import org.apache.dolphinscheduler.service.task.TaskPluginManager; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.context.event.ApplicationReadyEvent; import org.springframework.boot.web.servlet.ServletComponentScan; import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.event.EventListener; @ServletComponentScan @SpringBootApplication @ComponentScan("org.apache.dolphinscheduler") public class ApiApplicationServer { + @Autowired + private TaskPluginManager taskPluginManager; + public static void main(String[] args) { SpringApplication.run(ApiApplicationServer.class); } + @EventListener + public void run(ApplicationReadyEvent readyEvent) { + // install task plugin + taskPluginManager.installPlugin(); + } }