Polish Dispose default Scheduler
This commit is contained in:
parent
e0414e5cbe
commit
fc8a0184b0
|
@ -56,8 +56,9 @@ public abstract class AbstractUserDetailsReactiveAuthenticationManager implement
|
||||||
|
|
||||||
private ReactiveUserDetailsPasswordService userDetailsPasswordService;
|
private ReactiveUserDetailsPasswordService userDetailsPasswordService;
|
||||||
|
|
||||||
Scheduler scheduler = Schedulers.newParallel("password-encoder");
|
private final Scheduler DEFAULT_SCHEDULER = Schedulers.newParallel("password-encoder");
|
||||||
private boolean defaultScheduler = true;
|
|
||||||
|
private Scheduler scheduler = this.DEFAULT_SCHEDULER;
|
||||||
|
|
||||||
private UserDetailsChecker preAuthenticationChecks = user -> {
|
private UserDetailsChecker preAuthenticationChecks = user -> {
|
||||||
if (!user.isAccountNonLocked()) {
|
if (!user.isAccountNonLocked()) {
|
||||||
|
@ -140,10 +141,6 @@ public abstract class AbstractUserDetailsReactiveAuthenticationManager implement
|
||||||
*/
|
*/
|
||||||
public void setScheduler(Scheduler scheduler) {
|
public void setScheduler(Scheduler scheduler) {
|
||||||
Assert.notNull(scheduler, "scheduler cannot be null");
|
Assert.notNull(scheduler, "scheduler cannot be null");
|
||||||
if (this.defaultScheduler) {
|
|
||||||
this.defaultScheduler = false;
|
|
||||||
this.scheduler.dispose();
|
|
||||||
}
|
|
||||||
this.scheduler = scheduler;
|
this.scheduler = scheduler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,8 +176,6 @@ public abstract class AbstractUserDetailsReactiveAuthenticationManager implement
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void destroy() {
|
public void destroy() {
|
||||||
if (this.defaultScheduler) {
|
this.DEFAULT_SCHEDULER.dispose();
|
||||||
this.scheduler.dispose();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue