package com.uas.platform.b2b.erp.support;

import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.uas.platform.core.logging.BufferedLoggerManager;

/**
 * 定时任务<br>
 * 将erp交互的日志文件的内容每隔30秒持久化一次
 * 
 * @author yingp
 *
 */
@Component
@EnableAsync
@EnableScheduling
public class ErpLogTask {

	private final static ErpBufferedLogger logger = BufferedLoggerManager.getLogger(ErpBufferedLogger.class);

	@Scheduled(fixedRate = 30 * 1000)
	@Async
	public void execute() {
		logger.switchOver();
	}

}
