package net.northking.cctp.daemon;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.ApplicationPidFileWriter;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.scheduling.annotation.EnableScheduling;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@EnableScheduling
@EnableConfigurationProperties
@SpringBootApplication
@EnableSwagger2
public class DaemonApplication
{
  private static final Logger logger = LoggerFactory.getLogger(DaemonApplication.class);

  public static void main(String[] args)
  {
    logger.info("脚本守护进程 启动----开始 .................");
    String pidFile = "daemon.pid";
    SpringApplication app = new SpringApplication(DaemonApplication.class);
    // 指定PID文件
    app.addListeners(new ApplicationPidFileWriter(pidFile));
    app.run(args);

    logger.info("脚本守护进程 启动----完成 .................");


  }


}
