Skip to content

Commit

Permalink
Sleep between connection attempts
Browse files Browse the repository at this point in the history
  • Loading branch information
flowerysong committed Jul 12, 2024
1 parent 9280a22 commit afc1822
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugins/module_utils/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import json
import os

from time import sleep

from ansible.module_utils.basic import env_fallback
from ansible.module_utils.common.text.converters import jsonify
from ansible.module_utils.six.moves.urllib.error import (
Expand Down Expand Up @@ -168,6 +170,7 @@ def _open_url(self, path, method, data=None, fatal=True):

except ConnectionError as e:
if attempt < 5:
sleep(attempt)
continue
if self._module:
failure = {
Expand Down

0 comments on commit afc1822

Please sign in to comment.