|
@@ -36,9 +36,9 @@ public class OpcTask {
|
|
|
/**
|
|
|
* 新增点位:在新增点位后,点击立即生效按钮,这个时间不能再执行上面的addItems()方法
|
|
|
* 删除点位:在点位,点击取消采集按钮
|
|
|
- * 每100秒*
|
|
|
+ * 每10秒*
|
|
|
*/
|
|
|
- @Scheduled(fixedDelay = 100000)
|
|
|
+ @Scheduled(fixedDelay = 60000)
|
|
|
public void addAndDelItems() {
|
|
|
log.info("启动追加");
|
|
|
String ok = RedisUtils.getString(RedisKeyConstants.redis_ok);
|
|
@@ -93,9 +93,9 @@ public class OpcTask {
|
|
|
|
|
|
/**
|
|
|
* 1: 分组获取数据
|
|
|
- * a:保存到redis,前端页面实时从数据库获取数据,5秒刷新一次
|
|
|
+ * a:保存到redis
|
|
|
*/
|
|
|
- @Scheduled(fixedDelay = 2000) //间隔2秒
|
|
|
+ @Scheduled(fixedDelay = 1000) //间隔1秒
|
|
|
public void getValue() throws JIException {
|
|
|
String key = RedisUtils.getString(RedisKeyConstants.redis_opc_update_flag);
|
|
|
String ok = RedisUtils.getString(RedisKeyConstants.redis_ok);
|
|
@@ -114,7 +114,7 @@ public class OpcTask {
|
|
|
* 1)循环查询点位在当天是否存在记录,如果存在,则追加
|
|
|
* 2)批量写入数据库,每天的数据追加到一条里面
|
|
|
*/
|
|
|
- @Scheduled(fixedDelay = 100000) //间隔10秒,保存一次数据到数据库,确保每天不超过700万数据
|
|
|
+ @Scheduled(fixedDelay = 10000) //间隔10秒,保存一次数据到数据库
|
|
|
public void saveValue() throws JIException {
|
|
|
String key = RedisUtils.getString(RedisKeyConstants.redis_opc_update_flag);
|
|
|
String ok = RedisUtils.getString(RedisKeyConstants.redis_ok);
|