Skip to content

[HCR-426] 함수 시그니처 변경#72

Closed
rettooo wants to merge 1 commit into
mainfrom
hotfix/HSC-426
Closed

[HCR-426] 함수 시그니처 변경#72
rettooo wants to merge 1 commit into
mainfrom
hotfix/HSC-426

Conversation

@rettooo
Copy link
Copy Markdown
Contributor

@rettooo rettooo commented Mar 31, 2026

📝작업 내용


👀변경 사항


🎫 Jira Ticket

  • Jira Ticket: HCR-426

#️⃣관련 이슈

@rettooo rettooo closed this Mar 31, 2026
@github-actions github-actions Bot added Customer Team deploy:intelligence-server release:patch 버전 patch bump: X.Y.(Z+1) ☁️ area: INFRA 인프라/운영/배포 영역 🔥 priority: P0 즉시 처리 필요(서비스/데모 블로커) 🗂️ area: BE 백엔드 영역 🚑 hotfix 프로덕션 긴급 수정(우회/긴급 패치 포함) labels Mar 31, 2026
@github-actions github-actions Bot changed the title [HSC-426] fix: 함수 시그니처 변경 [HCR-426] 함수 시그니처 변경 Mar 31, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a trace_id parameter to the run_recommendation_and_publish_to_kafka function to enhance traceability during background recommendation processing and Kafka publishing. The review feedback suggests extending this traceability by passing the trace_id into the get_recommendation function and simplifying the log formatting logic to more clearly represent null trace IDs.

try:
resp = await get_recommendation(session=None, member_id=member_id)
await publish_recommendation_to_kafka(member_id, resp)
await publish_recommendation_to_kafka(member_id, resp, trace_id=trace_id)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

trace_id가 도입되었으나, get_recommendation 호출 시에는 전달되지 않고 있습니다. 전체 프로세스의 추적성(traceability)을 위해 get_recommendation 함수와 그 내부의 RecommendationService에서도 trace_id를 받아 로그에 포함할 수 있도록 개선하는 것이 좋습니다. (참고: get_recommendation 함수의 시그니처 변경도 함께 필요합니다.)

logger.error(
"recommendation: 백그라운드 추천/Kafka 실패 member_id=%s trace_id=%s: %s",
member_id,
(trace_id or "").strip(),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

trace_idNone인 경우 (trace_id or "").strip()은 빈 문자열("")을 반환하여 로그에 trace_id=:와 같이 출력됩니다. trace_id를 직접 전달하면 None인 경우 trace_id=None:으로 출력되어 더 명확하며, 불필요한 strip() 호출도 줄일 수 있습니다.

Suggested change
(trace_id or "").strip(),
trace_id,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🗂️ area: BE 백엔드 영역 ☁️ area: INFRA 인프라/운영/배포 영역 Customer Team deploy:intelligence-server 🚑 hotfix 프로덕션 긴급 수정(우회/긴급 패치 포함) 🔥 priority: P0 즉시 처리 필요(서비스/데모 블로커) release:patch 버전 patch bump: X.Y.(Z+1)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant