You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i lately experience the issue that if i try to create some jira-issues via api that i receive the error message "429 rate limit exceeded" wich is blocking the process of creating further issues.
is there a way to define/overwrite the own session as it is done in the example below from ATC ?
for ATC there is a solution but this does not seem to work for jira-python api
creds = _get_credential(USER)
atc = Confluence(
url=CONFLUENCE["URL"],
username=creds.username,
password=creds.password,
session=SESSION,
)
log = logging.getLogger(__name__)
class CustomSession(Session):
def __init__(self) -> None:
super().__init__()
# Disable all cookies for our session, because the the x-rate-limit headers will not be sent otherwise
self.cookies.set_policy(BlockAll())
def send(self, request: PreparedRequest, **kwargs) -> Response:
# log.debug(f"send - {request.method} {request.url}")
response = super().send(request, **kwargs)
remaining = response.headers.get("X-RateLimit-Remaining")
if remaining is not None and int(remaining) == 0:
# Obervation: Sometimes the interval is not enough, so we have to wait at least 5 sec
interval = max(int(response.headers.get("retry-after")), 5)
log.warning(f"Rate limit reached! - ⏳ sleeping {interval}")
time.sleep(interval)
return response
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
HI all,
i lately experience the issue that if i try to create some jira-issues via api that i receive the error message "429 rate limit exceeded" wich is blocking the process of creating further issues.
is there a way to define/overwrite the own session as it is done in the example below from ATC ?
topic is described here:
https://developer.atlassian.com/cloud/jira/platform/rate-limiting/
for ATC there is a solution but this does not seem to work for jira-python api
Beta Was this translation helpful? Give feedback.
All reactions