8000 Merge pull request #57 from homeylab/change_back_off_retry_behavior · homeylab/bookstack-file-exporter@f1f36ab · GitHub
[go: up one dir, main page]

Skip to content

Commit f1f36ab

Browse files
authored
Merge pull request #57 from homeylab/change_back_off_retry_behavior
Change back off retry behavior
2 parents 6f4520e + c34da95 commit f1f36ab

File tree

2 files changed

+37
-9
lines changed

2 files changed

+37
-9
lines changed

.github/workflows/on_release.yml

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,37 @@ jobs:
5454
timeout-minutes: 20
5555
environment: 'PyPi'
5656
steps:
57-
- name: Checkout
58-
uses: actions/checkout@v4
59-
- name: Deploy release to PyPi
60-
uses: ./.github/actions/python
61-
with:
62-
pypi_api_token: "${{ secrets.PYPI_API_TOKEN }}"
57+
- name: Get tag release without v
58+
shell: bash
59+
run: |
60+
TAG=${{ github.ref_name }}
61+
echo "VERSION=${TAG#v}" >> "$GITHUB_ENV"
62+
echo "Tag without v is: ${VERSION}"
63+
- name: Update Release Tag
64+
shell: bash
65+
run: sed -i "s/^version = [^ ]*/version = ${{ env.VERSION }}/" setup.cfg
66+
- name: Set up Python
67+
uses: actions/setup-python@v3
68+
with:
69+
python-version: '3.13.2'
70+
- name: Install Dependencies
71+
shell: bash
72+
run: |
73+
python -m pip install --upgrade pip
74+
pip install build
75+
- name: Build Python Package
76+
shell: bash
77+
run: |
78+
python -m pip install --upgrade build
79+
python -m build
80+
- name: Publish to PyPi
81+
uses: pypa/gh-action-pypi-publish@release/v1
82+
with:
83+
password: ${{ secrets.PYPI_API_TOKEN }}
84+
skip-existing: true
85+
# - name: Checkout
86+
# uses: actions/checkout@v4
87+
# - name: Deploy release to PyPi
88+
# uses: ./.github/actions/python
89+
# with:
90+
# pypi_api_token: "${{ secrets.PYPI_API_TOKEN }}"

bookstack_file_exporter/common/util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ def http_get_request(url: str, headers: Dict[str, str],
1616
# {backoff factor} * (2 ** ({number of previous retries}))
1717
# {raise_on_status} if status falls in status_forcelist range
1818
# and retries have been exhausted.
19-
# {status_force_list} 429 is supposed to be included
20-
retries = Retry(total=3,
19+
# {status_force_list} 413, 429, 503 defaults are overwritten with additional ones
20+
retries = Retry(total=5,
2121
backoff_factor=0.5,
2222
raise_on_status=True,
23-
status_forcelist=[ 500, 502, 503, 504 ])
23+
status_forcelist=[413, 429, 500, 502, 503, 504])
2424
session.mount(url_prefix, HTTPAdapter(max_retries=retries))
2525
response = session.get(url, headers=headers, verify=verify_ssl, timeout=timeout)
2626
except Exception as req_err:

0 commit comments

Comments
 (0)
0