Skip to content

Commit

Permalink
Adjust jira API call delay to 0.25 seconds
Browse files Browse the repository at this point in the history
Signed-off-by: John Strunk <[email protected]>
  • Loading branch information
JohnStrunk committed May 21, 2024
1 parent 8a43be0 commit 53b7ba3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion jiraissues.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
CF_STATUS_SUMMARY = "customfield_12320841" # string

# How long to delay between API calls
MIN_CALL_DELAY: float = 0.2
MIN_CALL_DELAY: float = 0.25


@dataclass
Expand Down
21 changes: 14 additions & 7 deletions summarizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@
from langchain_core.language_models import LLM

import text_wrapper
from jiraissues import Issue, RelatedIssue, descendants, get_self, issue_cache
from jiraissues import (
Issue,
RelatedIssue,
check_response,
descendants,
get_self,
issue_cache,
)

_logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -334,13 +341,13 @@ def get_issues_to_summarize(
# user, so we need to convert
user_zi = get_self(client).tzinfo
since_string = since.astimezone(user_zi).strftime("%Y-%m-%d %H:%M")
updated_issues = client.jql(
f"labels = '{SUMMARY_ALLOWED_LABEL}' and updated >= '{since_string}' ORDER BY updated DESC",
limit=50,
fields="key,updated",
updated_issues = check_response(
client.jql(
f"labels = '{SUMMARY_ALLOWED_LABEL}' and updated >= '{since_string}' ORDER BY updated DESC", # pylint: disable=line-too-long
limit=50,
fields="key,updated",
)
)
if not isinstance(updated_issues, dict):
return []
keys: List[str] = [issue["key"] for issue in updated_issues["issues"]]
# Filter out any issues that are not in the allowed projects
filtered_keys = []
Expand Down

0 comments on commit 53b7ba3

Please sign in to comment.