SHIRO-515 [1/2] Mark the ExecutorServiceSessionValidationScheduler "enabled" even with a 0 interval
Project: http://git-wip-us.apache.org/repos/asf/shiro/repo Commit: http://git-wip-us.apache.org/repos/asf/shiro/commit/ddbafc42 Tree: http://git-wip-us.apache.org/repos/asf/shiro/tree/ddbafc42 Diff: http://git-wip-us.apache.org/repos/asf/shiro/diff/ddbafc42 Branch: refs/heads/master Commit: ddbafc42792b436371b0775dc25d3155c37384b0 Parents: 235209e Author: Andreas Kohn <[email protected]> Authored: Tue Jun 28 18:46:51 2016 +0200 Committer: Brian Demers <[email protected]> Committed: Wed Jun 29 10:04:18 2016 -0700 ---------------------------------------------------------------------- .../session/mgt/ExecutorServiceSessionValidationScheduler.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/shiro/blob/ddbafc42/core/src/main/java/org/apache/shiro/session/mgt/ExecutorServiceSessionValidationScheduler.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/shiro/session/mgt/ExecutorServiceSessionValidationScheduler.java b/core/src/main/java/org/apache/shiro/session/mgt/ExecutorServiceSessionValidationScheduler.java index 6c24c1b..3b4cf70 100644 --- a/core/src/main/java/org/apache/shiro/session/mgt/ExecutorServiceSessionValidationScheduler.java +++ b/core/src/main/java/org/apache/shiro/session/mgt/ExecutorServiceSessionValidationScheduler.java @@ -90,8 +90,8 @@ public class ExecutorServiceSessionValidationScheduler implements SessionValidat } }); this.service.scheduleAtFixedRate(this, interval, interval, TimeUnit.MILLISECONDS); - this.enabled = true; } + this.enabled = true; } public void run() { @@ -107,7 +107,9 @@ public class ExecutorServiceSessionValidationScheduler implements SessionValidat } public void disableSessionValidation() { - this.service.shutdownNow(); + if (this.service != null) { + this.service.shutdownNow(); + } this.enabled = false; } }
