/*
package com.xisc.pm.config;

import com.netflix.discovery.DiscoveryManager;
import com.netflix.discovery.EurekaClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextClosedEvent;
import org.springframework.stereotype.Component;

*/
/**
 * 优雅关机
 *
 * @author 汉得-杨杰
 * @date 2024/11/20
 *//*

@Component
public class GracefulShutdown implements ApplicationListener<ContextClosedEvent> {

    private static final Logger LOGGER = LoggerFactory.getLogger(GracefulShutdown.class);

    @Autowired
    private EurekaClient eurekaClient;
    @Override
    public void onApplicationEvent(ContextClosedEvent event) {
        // 取消注册节点，等待微服务客户端更新服务列表。保障不再有新的请求进来
        LOGGER.info("eureka offline begin ");
        eurekaClient.shutdown();
        LOGGER.info("eureka offline end ");
    }

}*/
