-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
♻️ refactor: Feed Crawler, Server 환경 변수 이름 및 위치 통일, 로깅 범위 결정 (5) #42
Draft
Jo-Minseok
wants to merge
51
commits into
main
Choose a base branch
from
refactor/log-env
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ctor/docker-compose
…ctor/docker-compose
…to refactor/docker-compose
…actor/docker-compose
…actor/docker-compose
…to refactor/docker-compose
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🔨 테스크
이전 PR 보러 가기
작업 사유
기존에는 PM2로 NODE_ENV 환경 변수를 주입받는 방식이었다.
앞으로는 Docker Compose를 통해 NODE_ENV를 주입하도록 한다.
Docker Compose를 구성하면서 포트폴리오를 위한 환경이 추가되어야 하며, 환경 변수 파일 위치, 이름이 서로 맞지 않는 부분이 불편하다고 느껴졌다.
환경 변수 통일 + 로깅 범위 통일
Feed Crawler와 Server의 환경 변수 위치와 이름이 동일하지 않아 확인하기 어려웠다.
또한 로깅하는 범위가 달라서 통일이 필요했다.
로컬(포트폴리오 환경)은 포트폴리오를 위해 SQL 출력과 로깅이 제대로 되는지 확인하기 편하도록 구성했다.
Feed Crawler 테스트 데이터 실제 데이터 문제
Feed Crawler의 테스트 데이터가 실제 준혁님 블로그로 되어 있었다. 그리고 TIME_INTERVAL(단위: 분)이 20160으로 되어 있었다. 일자로 연산하면 14일의 시간이 나오는데, 14일 이내에 준혁님 블로그에 새로운 게시글이 없으면 테스트 오류가 발생하는 문제가 있었다.
RSS를 통해 게시글을 로드하는 코드를 Mocking 처리했다.
.env 파일 깃허브에 올려도 될까?
LOCAL 환경 변수들은 Docker Compose를 사용하는 사용자 로컬에서만 동작하기에 민감 정보가 포함되어 있지 않다.
괜히 포트폴리오용으로 제출한 프로젝트에 .env 파일 만들고 대입하는 게 프로젝트에 있는 도커를 사용하는 사람 입장에서는 번거롭다.
Feed Crawler의 환경 변수 로드 위치
constant.ts, mysql-access.ts, redis-access.ts로 총 3회 동일한 환경 변수를 로드한다. 이 코드를 env-load.ts 로 하나로 통합하고 단 1회만 로드하게 변경했다.
📋 작업 내용