Skip to content

Commit

Permalink
Merge pull request #148 from gitautoai/wes
Browse files Browse the repository at this point in the history
Wes
  • Loading branch information
hiroshinishio authored Jul 2, 2024
2 parents b09e127 + a19a87f commit 1fecafd
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cloudformation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Resources:
Properties:
Name: SchedulerEventRule
Description: "Schedule Lambda function to run every weekday at 0 AM UTC"
ScheduleExpression: cron(25 8 ? * MON-FRI *) # min hour day month day-of-week year
ScheduleExpression: cron(45 8 ? * MON-FRI *) # min hour day month day-of-week year
State: ENABLED
Targets:
- Arn: !Ref LambdaFunctionArn
Expand Down
2 changes: 0 additions & 2 deletions services/github/github_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,6 @@ def get_installation_access_token(installation_id: int) -> str:
jwt_token: str = create_jwt()
headers: dict[str, str] = create_headers(token=jwt_token)
url = f"{GITHUB_API_URL}/app/installations/{installation_id}/access_tokens"
print(f"jwt_token: {jwt_token}\n")
print(f"headers: {headers}\n")
response: requests.Response = requests.post(
url=url, headers=headers, timeout=TIMEOUT_IN_SECONDS
)
Expand Down
4 changes: 1 addition & 3 deletions services/supabase/gitauto_manager.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Class to manage all GitAuto related operations"""

from datetime import datetime, timezone
import json
from supabase import Client
from services.stripe.customer import create_stripe_customer, subscribe_to_free_plan
from utils.handle_exceptions import handle_exceptions
Expand Down Expand Up @@ -152,15 +151,14 @@ def delete_installation(self, installation_id: int) -> None:

@handle_exceptions(default_return_value=None, raise_on_error=False)
def get_installation_id(self, owner_id: int) -> int:
"""Get installation id for the owner"""
"""https://supabase.com/docs/reference/python/is"""
data, _ = (
self.client.table(table_name="installations")
.select("installation_id")
.eq(column="owner_id", value=owner_id)
.is_(column="uninstalled_at", value="null") # Not uninstalled
.execute()
)
print(f"Data: {json.dumps(obj=data, indent=2)}")
# Return the first installation id even if there are multiple installations
return data[1][0]["installation_id"]

Expand Down

0 comments on commit 1fecafd

Please sign in to comment.