File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
core/src/main/java/dev/vml/es/acm/core/script Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 24
24
import java .util .Map ;
25
25
import java .util .Optional ;
26
26
import java .util .concurrent .ConcurrentHashMap ;
27
+ import java .util .concurrent .ExecutorService ;
27
28
import java .util .concurrent .Executors ;
28
29
import org .apache .commons .lang3 .StringUtils ;
29
30
import org .apache .sling .api .resource .LoginException ;
@@ -137,12 +138,15 @@ public static JobType of(String value) {
137
138
138
139
private Config config ;
139
140
141
+ private ExecutorService deployJobExecutor ;
142
+
140
143
@ Activate
141
144
protected void activate (Config config ) {
142
145
this .config = config ;
143
146
144
147
if (checkInstanceReady ()) {
145
- Executors .newSingleThreadExecutor ().execute (this ::deployJob );
148
+ deployJobExecutor = Executors .newSingleThreadExecutor ();
149
+ deployJobExecutor .execute (this ::deployJob );
146
150
}
147
151
}
148
152
@@ -153,6 +157,10 @@ protected void modify(Config config) {
153
157
154
158
@ Deactivate
155
159
protected void deactivate () {
160
+ if (deployJobExecutor != null ) {
161
+ deployJobExecutor .shutdownNow ();
162
+ deployJobExecutor = null ;
163
+ }
156
164
unscheduleBoot ();
157
165
unscheduleScripts ();
158
166
bootedScripts .clear ();
You can’t perform that action at this time.
0 commit comments