File tree Expand file tree Collapse file tree 3 files changed +40
-2
lines changed
Expand file tree Collapse file tree 3 files changed +40
-2
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # src 디렉토리로 이동
4+ cd " $( dirname " $0 " ) /../src" || exit
5+
6+ # 실행 중인 Gunicorn 프로세스 종료
7+ echo " Stopping Gunicorn..."
8+ killall gunicorn 2> /dev/null || echo " No Gunicorn processes found."
9+
10+ # 실행 중인 Celery 워커 프로세스 종료
11+ echo " Stopping Celery workers..."
12+ pkill -f " celery -A celery_worker worker" 2> /dev/null || echo " No Celery worker processes found."
13+
14+ # 새로운 Celery 워커 시작
15+ echo " Starting Celery workers..."
16+ PYTHONPATH=$( pwd) /home/ubuntu/.cache/pypoetry/virtualenvs/tellingme-python-server-p3Rjg27q-py3.12/bin/python -m celery -A celery_worker worker --loglevel=info --concurrency=1 &
17+
18+ # 새로운 Gunicorn 시작
19+ echo " Starting Gunicorn..."
20+ poetry run nohup gunicorn main:app --workers 2 --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:8000 >> gunicorn.log 2>&1 &
21+
22+ echo " Services restarted successfully."
Original file line number Diff line number Diff line change 88from app .v2 .answers .querys .answer_query import (
99 SELECT_ANSWER_BY_USER_UUID_QUERY ,
1010 SELECT_ANSWER_COUNT_BY_USER_UUID_QUERY ,
11- SELECT_MOST_RECENT_ANSWER_BY_USER_UUID_QUERY ,
1211 SELECT_ANSWER_COUNT_BY_USER_UUID_QUERY_V2 ,
12+ SELECT_MOST_RECENT_ANSWER_BY_USER_UUID_QUERY ,
1313)
1414from app .v2 .users .models .user import User
1515from common .utils .query_executor import QueryExecutor
Original file line number Diff line number Diff line change 1- from fastapi import APIRouter
1+ from typing import Any
22
3+ from fastapi import APIRouter , Depends
4+
5+ from app .v2 .missions .services .mission_service import MissionService
36from core .configs .celery_settings import process_mission_in_background
47
58router = APIRouter (prefix = "/mission" , tags = ["Mission" ])
811@router .get ("" )
912async def mission_handler (user_id : str ) -> None :
1013 process_mission_in_background .delay (user_id )
14+
15+
16+ @router .get ("/direct" )
17+ async def mission_handler_direct (
18+ user_id : str ,
19+ mission_service : MissionService = Depends (),
20+ ) -> dict [str , Any ]:
21+ await mission_service .update_mission_progress (user_id = user_id )
22+ return {
23+ "code" : 200 ,
24+ "message" : "success" ,
25+ "data" : True ,
26+ }
You can’t perform that action at this time.
0 commit comments