后端架构更新

This commit is contained in:
super
2026-04-27 09:18:10 +08:00
parent 8ea7e949c2
commit 7e1974a688
141 changed files with 6957 additions and 772 deletions
@@ -36,7 +36,13 @@ public class DistributedJobLockService {
Duration actualTtl = (ttl == null || ttl.isNegative() || ttl.isZero()) ? Duration.ofMinutes(10) : ttl;
String key = buildLockKey(jobName);
String token = ownerPrefix + ":" + UUID.randomUUID();
Boolean locked = stringRedisTemplate.opsForValue().setIfAbsent(key, token, actualTtl);
Boolean locked;
try {
locked = stringRedisTemplate.opsForValue().setIfAbsent(key, token, actualTtl);
} catch (Exception ex) {
log.warn("[job-lock] acquire skipped jobName={} key={} msg={}", jobName, key, ex.getMessage());
return null;
}
if (!Boolean.TRUE.equals(locked)) {
return null;
}