java - Spring调度程序运行两次
问题描述
我在 JBoss 中部署了主从应用程序,因此我的调度程序运行了两次。ShedLock不是我的问题的解决方案,因为电子邮件将触发直到用户停用过期的资产。所以我虽然检查请求是来自主机还是从机,并基于它运行我的代码,知道如何计算它或任何其他解决方案。谢谢我正在使用带有 MySQL db 的 Spring 4.x 和 REST Web 服务。
@Scheduled(cron = "${scheduler.i18n.crontime}")
public void getAssetNotification() {
try {
notificationDao.getAssetNotification(null);
} catch (Exception e) {
logger.error("getAssetNotification() - error in getAssetNotification", e);
}
}
解决方案
推荐阅读
- python - __init__() 得到了一个意外的关键字参数“chi1”
- reactjs - 为什么静态文件在 django 应用程序中给出未找到错误?
- powerbi - 新计算表以每小时拆分持续时间
- c - 递归函数中的分段错误,同时解析目录
- python - 为什么我的类对象的实例最终成为我的方法中的参数?
- reactjs - 从 api url 中的数据格式化 react.js 中的日期
- r - 用R中的最后一个非空单元格和下一个非空单元格填充列中两个值之间的空单元格
- javascript - Chrome 扩展导入/导出
- python - Python字典平均值函数
- python - 制作 Flappy Bird 但我如何实现在屏幕外生成然后穿过屏幕并消失的管道