Gregniuki commited on
Commit
616d5ed
·
1 Parent(s): 9854960

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +5 -2
main.py CHANGED
@@ -12,6 +12,7 @@ from typing import Optional
12
  #import auth
13
  #import tts
14
  import os
 
15
 
16
  my_secret_key = os.environ['my_secret_key']
17
  app = FastAPI()
@@ -157,8 +158,10 @@ async def register_post(
157
  recaptcha_action = 'submit' # The action you're expecting
158
 
159
  # Call the create_assessment function to validate the token
160
- assessment = await create_assessment(
161
- project_id, recaptcha_key, recaptcha_token, recaptcha_action
 
 
162
  )
163
 
164
  # Check the assessment result
 
12
  #import auth
13
  #import tts
14
  import os
15
+ import asyncio
16
 
17
  my_secret_key = os.environ['my_secret_key']
18
  app = FastAPI()
 
158
  recaptcha_action = 'submit' # The action you're expecting
159
 
160
  # Call the create_assessment function to validate the token
161
+ # assessment = await create_assessment( project_id, recaptcha_key, recaptcha_token, recaptcha_action )
162
+ loop = asyncio.get_running_loop()
163
+ assessment = await loop.run_in_executor(
164
+ None, create_assessment, project_id, recaptcha_key, recaptcha_token, recaptcha_action
165
  )
166
 
167
  # Check the assessment result