crawling check
This commit is contained in:
1 parent
0d3543d84d
commit
26cd946e1b
5 files changed
+14
-2
No files matched your search
+4
-2
@@ -1,5 +1,5 @@
|
||||
import uuid6
|
||||
from fastapi import APIRouter, BackgroundTasks, Depends, status
|
||||
from fastapi import APIRouter, BackgroundTasks, Depends, status, HTTPException
|
||||
from common.deps import verify_api_key
|
||||
from common.db import fetchone, insert_instagram_row, insert_facebook_row, insert_naver_blog_row, insert_youtube_row, insert_gangnam_unni_row, insert_analysis_run
|
||||
from models.analysis import AnalysisCreate, AnalysisStartResponse, AnalysisStatusResponse
|
||||
@@ -19,6 +19,8 @@ async def start_analysis(body: AnalysisCreate, background_tasks: BackgroundTasks
|
||||
"SELECT owner_user_id FROM hospital_baseinfo WHERE hospital_id = %s",
|
||||
(hospital_id,),
|
||||
)
|
||||
if not hospital:
|
||||
raise HTTPException(status_code=409, detail="Clinic not found")
|
||||
owner_user_id = hospital["owner_user_id"] if hospital else 0
|
||||
|
||||
ig_url = body.channels.instagram[0] if isinstance(body.channels.instagram, list) else body.channels.instagram
|
||||
@@ -33,7 +35,7 @@ async def start_analysis(body: AnalysisCreate, background_tasks: BackgroundTasks
|
||||
if ig_id:
|
||||
background_tasks.add_task(collect_instagram, analysis_run_id, ig_id, ig_url)
|
||||
if fb_id:
|
||||
background_tasks.add_task(collect_facebook, analysis_run_id, fb_id, body.channels.facebook)
|
||||
background_tasks.add_task(collect_facebook, analysis_run_id, fb_id, f"https://www.facebook.com/{body.channels.facebook}")
|
||||
if nb_id:
|
||||
background_tasks.add_task(collect_naver_blog, analysis_run_id, nb_id, body.channels.naver_blog)
|
||||
if yt_id:
|
||||
|
||||
Reference in new issue
Block a user