public class ScheduledThreadPool {
public static ScheduledExecutorService scheduledThreadPool = Executors.newScheduledThreadPool(10);
}
、、、、、、、、、
ScheduledThreadPool.scheduledThreadPool.schedule(new Runnable() {
@Override
public void run() {
try {
push(mobilePhones, pushBean, content, isPushApn);
} catch (IOException e) {
logger.error("推送消息出错,公司id:{},推送类型{}", companyId, pushBean.getType());
logger.error("推送消息出错:",e);
}
}
},1, TimeUnit.MINUTES);