mirror of https://github.com/halo-dev/halo
Change log level to warn for optimistic locking failure error (#2957)
#### What type of PR is this? /kind improvement #### What this PR does / why we need it: /kind api-change #### Which issue(s) this PR fixes: Fixes #2591 #### Special notes for your reviewer: #### Does this PR introduce a user-facing change? ```release-note NONE ```pull/2962/merge
parent
c90f19211f
commit
64550d235f
|
@ -11,6 +11,7 @@ import java.util.function.Supplier;
|
|||
import java.util.stream.IntStream;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
|
||||
import org.springframework.dao.OptimisticLockingFailureException;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StopWatch;
|
||||
|
@ -167,9 +168,14 @@ public class DefaultController<R> implements Controller {
|
|||
log.trace(watch.toString());
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
if (t instanceof OptimisticLockingFailureException) {
|
||||
log.warn("Optimistic locking failure when reconciling request: {}/{}",
|
||||
this.name, entry.getEntry());
|
||||
} else {
|
||||
log.error("Reconciler in " + this.name
|
||||
+ " aborted with an error, re-enqueuing...",
|
||||
t);
|
||||
}
|
||||
result = new Reconciler.Result(true, null);
|
||||
} finally {
|
||||
queue.done(entry.getEntry());
|
||||
|
|
Loading…
Reference in New Issue