Skip to content

Commit 17d9fd9

Browse files
committed
added cloud run SERVICE
1 parent 1fc7ffd commit 17d9fd9

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

airflow/HomePlus_dag.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
@task
2828
def send_post_request_HOMEPLUS_task(category_id):
29-
return send_post_request(category_id)
29+
return send_post_request('HP', category_id)
3030

3131
# TaskFlow API로 task 정의
3232
@task

airflow/Oasis_dag.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
@task
2828
def send_post_request_OASIS_task():
29-
return send_post_request()
29+
return send_post_request('OA')
3030

3131
# TaskFlow API로 task 정의
3232
@task

airflow/requirements/modules.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,13 @@ def collect_task_results(**context):
2929
context['ti'].xcom_push(key='email_body', value=email_body)
3030

3131
# HTTP POST 요청 함수
32-
def send_post_request(categoryId):
32+
def send_post_request(platform, categoryId):
3333
load_dotenv()
34-
url = os.getenv("HOMEPLUS_SERVICE_URL")
34+
url = ""
35+
if platform == 'HP':
36+
url = os.getenv("HOMEPLUS_SERVICE_URL")
37+
elif platform == 'OA':
38+
url = os.getenv("OASIS_SERVICE_URL")
3539
headers = {"Content-Type": "application/json"}
3640
data = json.dumps({"category_id": categoryId})
3741
response = requests.post(url, headers=headers, data=data)

0 commit comments

Comments
 (0)