Skip to content

Commit

Permalink
max concurrency lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
timburke-hackit committed Nov 6, 2023
1 parent 23f8939 commit 7be89c8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lambdas/calculate_max_concurrency/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
def calculate_max_concurrency(available_ips: int, ips_per_job: int) -> int:
return int(available_ips / ips_per_job)


def lambda_handler(event, context):
available_ips = event["available_ips"]
ips_per_job = event["ips_per_job"]
max_concurrency = calculate_max_concurrency(available_ips, ips_per_job)
return {"max_concurrency": max_concurrency}


if __name__ == "__main__":
lambda_handler("event", "lambda_context")

0 comments on commit 7be89c8

Please sign in to comment.