修改es多节点启动

This commit is contained in:
sh
2026-03-27 18:06:29 +08:00
parent 45ae067883
commit 1dc3f15acf
2 changed files with 15 additions and 2 deletions

View File

@@ -96,10 +96,10 @@ public class ESJobSearchImpl implements IESJobSearchService
private boolean acquireDistributedLock() throws InterruptedException {
long start = System.currentTimeMillis();
while (System.currentTimeMillis() - start < WAIT_LOCK_SECONDS * 1000) {
Boolean success = redisCache.setIfAbsent(ES_INIT_LOCK_KEY,"es_init_locked",
boolean success = redisCache.setIfAbsent(ES_INIT_LOCK_KEY,"es_init_locked",
LOCK_EXPIRE_SECONDS,TimeUnit.SECONDS
);
if (Boolean.TRUE.equals(success)) {
if (success) {
logger.info("成功获取ES初始化分布式锁key{}", ES_INIT_LOCK_KEY);
return true;
}