File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
spring-cloud-task-docs/src/main/asciidoc Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ updated in the repository with the results.
5252
5353NOTE: If the application requires the `ApplicationContext` to be closed at the
5454completion of a task (all `*Runner#run` methods have been called and the task
55- repository has been updated), set the property `spring.cloud.task.closecontext_enabled `
55+ repository has been updated), set the property `spring.cloud.task.closecontextEnabled `
5656to true.
5757
5858[[features-task-execution-details]]
@@ -394,4 +394,16 @@ This can be done either by adding the following annotation to your Task applicat
394394```
395395You may also disable Task auto configuration by setting the `spring.cloud.task.autoconfiguration.enabled` property to `false`.
396396
397-
397+ [[closing-the-context]]
398+ === Closing the Context
399+ If the application requires the `ApplicationContext` to be closed at the
400+ completion of a task (all `*Runner#run` methods have been called and the task
401+ repository has been updated), set the property `spring.cloud.task.closecontextEnabled`
402+ to `true`.
403+
404+ Another case to close the context is when the Task Execution completes however the application does not terminate.
405+ In these cases the context is held open because a thread has been allocated
406+ (for example: if you are using a TaskExecutor). In these cases
407+ set the `spring.cloud.task.closecontextEnabled` property to `true` when launching your task.
408+ This will close the application's context once the task is complete.
409+ Thus allowing the application to terminate.
You can’t perform that action at this time.
0 commit comments