Skip to content

Commit

Permalink
added both supabase secret keys to main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ayyubibrahimi committed Nov 16, 2023
1 parent a722323 commit a5edfd4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/googlecloud/functions/getanswer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,16 @@
db_general, db_in_depth, voting_roll_df = get_dbs()

# Setup Supabase client
supabase_url = os.environ.get("SUPABASE_URL_STAGING")
supabase_key = os.environ.get("SUPABASE_SERVICE_KEY_STAGING")
try:
supabase_url = os.environ["SUPABASE_URL_PRODUCTION"]
supabase_key = os.environ["SUPABASE_SERVICE_KEY_PRODUCTION"]
except KeyError:
supabase_url = os.environ.get("SUPABASE_URL_STAGING")
supabase_key = os.environ.get("SUPABASE_SERVICE_KEY_STAGING")

if not supabase_url or not supabase_key:
raise ValueError("Supabase URL and key must be set in environment variables")

supabase = create_client(supabase_url, supabase_key)

def update_supabase(responses, citations, card_id, processing_time_ms):
Expand Down

1 comment on commit a5edfd4

@vercel
Copy link

@vercel vercel bot commented on a5edfd4 Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.