mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-05 16:04:09 -07:00
Make interprocess polling interval configurable (#16560)
As recently there was back-and-forth with this hardcoded value (0.001 -> 0.01 -> 0.005), obviousely the optimal value for it depends on Ansible usage scanario and is better to be configurable. This patch adds a new config option in DEFAULT section, `internal_poll_interval`, with default of 0.001 corresponding to the value hardcoded in Ansible v2.1. This config option is then used instead of hardcoded values where needed. Related GH issue: 14219
This commit is contained in:
parent
f012159860
commit
aa1ec8af17
4 changed files with 20 additions and 3 deletions
|
@ -21,6 +21,7 @@ __metaclass__ = type
|
|||
|
||||
import time
|
||||
|
||||
from ansible import constants as C
|
||||
from ansible.errors import AnsibleError
|
||||
from ansible.playbook.included_file import IncludedFile
|
||||
from ansible.plugins import action_loader
|
||||
|
@ -202,7 +203,7 @@ class StrategyModule(StrategyBase):
|
|||
display.debug("done adding collected blocks to iterator")
|
||||
|
||||
# pause briefly so we don't spin lock
|
||||
time.sleep(0.001)
|
||||
time.sleep(C.DEFAULT_INTERNAL_POLL_INTERVAL)
|
||||
|
||||
# collect all the final results
|
||||
results = self._wait_on_pending_results(iterator)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue