Skip to content

Commit

Permalink
Merge pull request #123 from splunk/update_appinspect_wait_time
Browse files Browse the repository at this point in the history
Update appinspect api check interval
  • Loading branch information
pyth0n1c authored Mar 20, 2024
2 parents c93834c + a06cc01 commit 3c88c7c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion contentctl/output/conf_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,19 @@ def inspectAppAPI(self, username:str, password:str, stack_type:str)->str:
"Authorization": f"bearer {authorization_bearer}"
}
startTime = timeit.default_timer()
# the first time, wait for 40 seconds. subsequent times, wait for less.
# this is because appinspect takes some time to return, so there is no sense
# checking many times when we know it will take at least 40 seconds to run.
iteration_wait_time = 40
while True:

res = get(APPINSPECT_API_VALIDATION_STATUS, headers=headers)
res.raise_for_status()
status = res.json().get("status",None)
if status in ["PROCESSING", "PREPARING"]:
print(f"[{self.getElapsedTime(startTime)}] Appinspect API is {status}...")
time.sleep(15)
time.sleep(iteration_wait_time)
iteration_wait_time = 1
continue
elif status == "SUCCESS":
print(f"[{self.getElapsedTime(startTime)}] Appinspect API has finished!")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "contentctl"
version = "3.4.1"
version = "3.4.2"
description = "Splunk Content Control Tool"
authors = ["STRT <research@splunk.com>"]
license = "Apache 2.0"
Expand Down

0 comments on commit 3c88c7c

Please sign in to comment.