Skip to content

Commit

Permalink
Added section on closing the context
Browse files Browse the repository at this point in the history
  • Loading branch information
Glenn Renfro committed Feb 10, 2020
1 parent 37749ef commit fac4393
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion spring-cloud-task-docs/src/main/asciidoc/features.adoc
Original file line number Diff line number Diff line change
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.closecontext_enabled`
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.closecontext_enabled` 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 fac4393

Please sign in to comment.