Skip to content

Commit f7c2501

Browse files
cppwfsmminella
authored andcommitted
Added section on closing the context
resolves #646
1 parent 79c7bd3 commit f7c2501

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

spring-cloud-task-docs/src/main/asciidoc/features.adoc

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ updated in the repository with the results.
5252

5353
NOTE: If the application requires the `ApplicationContext` to be closed at the
5454
completion 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`
5656
to 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
```
395395
You 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.

0 commit comments

Comments
 (0)