Skip to content

Commit

Permalink
Added section on closing the context
Browse files Browse the repository at this point in the history
resolves #646
  • Loading branch information
Glenn Renfro authored and mminella committed Feb 18, 2020
1 parent 79c7bd3 commit f7c2501
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions spring-cloud-task-docs/src/main/asciidoc/features.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ updated in the repository with the results.

NOTE: If the application requires the `ApplicationContext` to be closed at the
completion of a task (all `*Runner#run` methods have been called and the task
repository has been updated), set the property `spring.cloud.task.closecontext_enabled`
repository has been updated), set the property `spring.cloud.task.closecontextEnabled`
to true.

[[features-task-execution-details]]
Expand Down Expand Up @@ -394,4 +394,16 @@ This can be done either by adding the following annotation to your Task applicat
```
You may also disable Task auto configuration by setting the `spring.cloud.task.autoconfiguration.enabled` property to `false`.


[[closing-the-context]]
=== Closing the Context
If the application requires the `ApplicationContext` to be closed at the
completion of a task (all `*Runner#run` methods have been called and the task
repository has been updated), set the property `spring.cloud.task.closecontextEnabled`
to `true`.

Another case to close the context is when the Task Execution completes however the application does not terminate.
In these cases the context is held open because a thread has been allocated
(for example: if you are using a TaskExecutor). In these cases
set the `spring.cloud.task.closecontextEnabled` property to `true` when launching your task.
This will close the application's context once the task is complete.
Thus allowing the application to terminate.

0 comments on commit f7c2501

Please sign in to comment.