package com.persagy.functions.weather.thread;

import org.apache.log4j.Logger;

import com.persagy.functions.weather.constant.Const;
import com.persagy.functions.weather.service.DependApiStaticService;


public class DependAPIStaticThread implements Runnable {
	private static final Logger log = Logger.getLogger(DependAPIStaticThread.class);
	private DependApiStaticService service;
	private String type;
	
	public DependAPIStaticThread(DependApiStaticService service, String type) {
		this.service = service;
		this.type = type;
	}


	@Override
	public void run() {
		log.info("dependAPIStastic 线程启动...");
		
		while(true) {
			try {
				Thread.sleep(Const.AboutTime.min5Minlliseconds);
				service.doStatistics(type);
			}catch (Exception e) {
				log.error("DependApiStatic Error, msg=" + e.getMessage());
				e.printStackTrace();
			}
		}
	}

}
