File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
frameworks/Java/tio-server/src/main/java/com/litongjava/tio/http/server Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 1313import com .litongjava .tio .http .server .handler .SimpleHttpRoutes ;
1414import com .litongjava .tio .server .ServerTioConfig ;
1515import com .litongjava .tio .utils .environment .EnvironmentUtils ;
16+ import org .slf4j .Logger ;
17+ import org .slf4j .LoggerFactory ;
1618
1719public class MainApp {
1820
1921 public static void main (String [] args ) {
22+ Logger log = LoggerFactory .getLogger (MainApp .class );
2023 long start = System .currentTimeMillis ();
2124 EnvironmentUtils .buildCmdArgsMap (args );
2225 // add route
@@ -51,9 +54,13 @@ public static void main(String[] args) {
5154 // start server
5255 try {
5356 httpServerStarter .start ();
54- new MysqlDbConfig ().init ();
55- new EnjoyEngineConfig ().engine ();
56- new EhCachePluginConfig ().ehCachePlugin ();
57+ if (!EnvironmentUtils .getBoolean ("native" )) {
58+ new MysqlDbConfig ().init ();
59+ new EnjoyEngineConfig ().engine ();
60+ new EhCachePluginConfig ().ehCachePlugin ();
61+ } else {
62+ log .info ("native mode,only start server" );
63+ }
5764 long end = System .currentTimeMillis ();
5865 System .out .println ((end - start ) + "ms" );
5966 } catch (Exception e ) {
You can’t perform that action at this time.
0 commit comments