Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #256 from sofastack/yuan_dev
Browse files Browse the repository at this point in the history
ServerlessApplicationListener adjust Ordered
  • Loading branch information
lvjing2 authored Nov 7, 2023
2 parents 7e454d8 + 8d792ea commit eb6a4fd
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@
import org.springframework.boot.context.event.ApplicationStartingEvent;
import org.springframework.boot.context.event.SpringApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.core.Ordered;

import static com.alipay.sofa.ark.spi.constant.Constants.PLUGIN_EXPORT_CLASS_ENABLE;

/**
* @author: yuanyuan
* @date: 2023/10/30 9:38 下午
*/
public class ServerlessApplicationListener implements ApplicationListener<SpringApplicationEvent> {
public class ServerlessApplicationListener implements ApplicationListener<SpringApplicationEvent>,
Ordered {

@Override
public void onApplicationEvent(SpringApplicationEvent event) {
Expand All @@ -41,4 +43,12 @@ public void onApplicationEvent(SpringApplicationEvent event) {
}
}
}

/**
* 优先级要高于 ArkApplicationStartListener 否则,会提前进入 ark 1.0 分支
*/
@Override
public int getOrder() {
return Ordered.HIGHEST_PRECEDENCE + 100;
}
}

0 comments on commit eb6a4fd

Please sign in to comment.