From bde8847f01b81b966b6100c2be930e67a78b3bd1 Mon Sep 17 00:00:00 2001 From: Hiroshi Nishio <4620828+hiroshinishio@users.noreply.github.com> Date: Thu, 4 Jul 2024 16:28:54 +0900 Subject: [PATCH] Fix get_installed_owners_and_repos encountered an TypeError: get_installed_owners_and_repos() got an unexpected keyword argument 'installation_id' --- cloudformation.yml | 2 +- scheduler.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cloudformation.yml b/cloudformation.yml index 002a2289..1bc9eba3 100644 --- a/cloudformation.yml +++ b/cloudformation.yml @@ -20,7 +20,7 @@ Resources: Properties: Name: SchedulerEventRule Description: "Schedule Lambda function to run every weekday at 0 AM UTC" - ScheduleExpression: cron(25 7 ? * MON-FRI *) # min hour day month day-of-week year + ScheduleExpression: cron(38 7 ? * MON-FRI *) # min hour day month day-of-week year State: ENABLED Targets: - Arn: !Ref LambdaFunctionArn diff --git a/scheduler.py b/scheduler.py index 4b6ec9b9..662e21bc 100644 --- a/scheduler.py +++ b/scheduler.py @@ -29,13 +29,12 @@ def schedule_handler(_event, _context) -> dict[str, int]: # Get the installation access token for each installation ID. token = get_installation_access_token(installation_id=installation_id) if token is None: - logging.info("Token is None for installation_id: %s, so skipping", installation_id) + msg = f"Token is None for installation_id: {installation_id}, so skipping" + logging.info(msg) continue # Get all owners and repositories for each installation ID. - owners_repos: list[dict[str, str]] = get_installed_owners_and_repos( - installation_id=installation_id, token=token - ) + owners_repos: list[dict[str, str]] = get_installed_owners_and_repos(token=token) # Process each owner and repository. for owner_repo in owners_repos: