@Every("1min")

a470 a470 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

@OnApplicationStart
@Every("1min")
public class TopMerchantTestJob extends Job {

private static Logger logger = LoggerFactory.getLogger(TopMerchantTestJob.class);

@Override
public void doJob() throws Exception {

Thread t = new Thread(new Runnable() {
public void run() {
long start = System.currentTimeMillis();
logger.info(TopMerchantTestJob.class.getName() + " started.");
TopMerchant.updateTopMerchantForTest();
logger.info(TopMerchantTestJob.class.getName() + " finished, elapsed time " + (System.currentTimeMillis() - start) + "ms.");
}
});

t.start();
}
}

这个代码是什么时候运行?@OnApplicationStart
@Every("1min")这是什么意思啊??为什么dojob里还有t.start。。。云里雾里啊,。。
...全文
评论 3
收藏 已收藏
分享
返回顶部
a470
Web 开发 81,108 成员 341,721 内容