Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Commit

Permalink
avoid hitting jira limits
Browse files Browse the repository at this point in the history
  • Loading branch information
adonm committed Jan 29, 2023
1 parent 8589a96 commit bc84b0e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions siem_query_utils/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -951,8 +951,8 @@ def save_date_issues(
f" {todate.date().isoformat()} order by key"
)
output = path / f"{fromdate.date().isoformat()}" / "issues.parquet"
if output.exists() and fromdate < pandas.Timestamp.now() - pandas.to_timedelta("2d"):
# skip previously dumped days except for last 2 days
if output.exists() and fromdate < pandas.Timestamp.now() - pandas.to_timedelta("1d"):
# skip previously dumped days except for last day
return None
start_at, total_rows = 0, -1
dataframes = []
Expand Down Expand Up @@ -1006,7 +1006,7 @@ def jiradata(siemref):
issues = response.json().get("issues")
except JSONDecodeError:
logger.warning(response.headers)
return None
raise
if issues:
return issues.pop()
else:
Expand Down Expand Up @@ -1110,6 +1110,6 @@ def update_jira(df):
updates = update_jira(df)
if updates.shape[0] > 0: # keep going until we get no updates
after = f"todatetime('{updates.TimeGenerated.max()}')"
sleep(30)
sleep(3)
else:
break

0 comments on commit bc84b0e

Please sign in to comment.