[BUG-7554] Fix database lose data in standalone (#7620)
* Fix the wrong lifecycle phase of initialization Co-authored-by: kezhenxu94 <kezhenxu94@apache.org>
This commit is contained in:
parent
c7d7eec679
commit
f450b7ef28
|
|
@ -28,7 +28,7 @@ import java.lang.annotation.Target;
|
|||
@Documented
|
||||
public @interface AccessLogAnnotation {
|
||||
// ignore request args
|
||||
String[] ignoreRequestArgs() default {};
|
||||
String[] ignoreRequestArgs() default {"loginUser"};
|
||||
|
||||
boolean ignoreRequest() default false;
|
||||
|
||||
|
|
|
|||
|
|
@ -31,9 +31,12 @@ spring:
|
|||
- taskDefinition
|
||||
caffeine:
|
||||
spec: maximumSize=100,expireAfterWrite=300s,recordStats
|
||||
sql:
|
||||
init:
|
||||
schema-locations: classpath:sql/dolphinscheduler_h2.sql
|
||||
datasource:
|
||||
driver-class-name: org.h2.Driver
|
||||
url: jdbc:h2:mem:dolphinscheduler;MODE=MySQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=true;INIT=runscript from 'classpath:sql/dolphinscheduler_h2.sql'
|
||||
url: jdbc:h2:mem:dolphinscheduler;MODE=MySQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=true
|
||||
username: sa
|
||||
password: ""
|
||||
quartz:
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@ import javax.annotation.PostConstruct;
|
|||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
|
|
@ -62,8 +64,8 @@ public class TaskPluginManager {
|
|||
return Collections.unmodifiableMap(taskChannelMap);
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void installPlugin() {
|
||||
@EventListener
|
||||
public void installPlugin(ApplicationReadyEvent readyEvent) {
|
||||
final Set<String> names = new HashSet<>();
|
||||
|
||||
ServiceLoader.load(TaskChannelFactory.class).forEach(factory -> {
|
||||
|
|
|
|||
Loading…
Reference in New Issue