Browse Source

clusters 3

master
gsd 6 months ago
parent
commit
b2f50b3ae3
  1. 4
      src/main/java/app/annotations/impl/ClusterMethodAspect.java
  2. 10
      src/main/java/app/services/db/DBService.java

4
src/main/java/app/annotations/impl/ClusterMethodAspect.java

@ -38,7 +38,7 @@ public class ClusterMethodAspect extends BaseUpdater {
private final RestTemplate restTemplate;
private final String[] clusters;
private final Logger logger = LoggerFactory.getLogger(getClass());
private final Long max_range = 300L;
private final Long max_range = 15L;
@Autowired
public ClusterMethodAspect(Environment environment) {
@ -101,7 +101,7 @@ public class ClusterMethodAspect extends BaseUpdater {
for(int i = 0; i < clusters.length; i++) {
int finalI = i;
this.logger.info("Create cluster pulse check on {}", clusters[finalI]);
CreateTaskUpdater(() -> checkCluster(clusters[finalI]), 60 * 1000, getClass().getName());
CreateTaskUpdater(() -> checkCluster(clusters[finalI]), 1000, getClass().getName());
}
}

10
src/main/java/app/services/db/DBService.java

@ -21,9 +21,13 @@ public class DBService {
JdbcTemplate jdbcTemplate_ro;
public Long getDBServerTime() {
Long rw_time = getMainServerTime();
Long ro_time = getReplicaServerTime();
return rw_time;
try {
Long rw_time = getMainServerTime();
Long ro_time = getReplicaServerTime();
return rw_time;
} catch (Exception e) {
return 0L;
}
}
public Long getMainServerTime() {

Loading…
Cancel
Save