Uh oh!
There was an error while loading. Please reload this page.
feat(content): 백엔드 공개 통계로 수치 자동 갱신 - #9
Merged
Merged
Conversation
사람이 직접 고치던 절차를 없앤다. 매주 화요일 새벽에 받아 와 PR 을 연다. 넷 중 하나라도 못 받으면 아무것도 바꾸지 않는다. 일부만 갱신하고 날짜를 새로 찍으면 낡은 값에 새 날짜가 붙어 거짓말이 된다. STATS_API_BASE 가 없으면 조용히 건너뛴다. 백엔드가 공개되기 전에 실패로 울리면 알림이 무의미해진다.
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or 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
Sign up for freeto 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.
Closes#8
수치 갱신을 사람 손에서 떼어냅니다. 매주 화요일 새벽에 백엔드 공개 통계에서 받아 와 PR 을 엽니다.
GET /facilities/statistics의typeDistributionGET /health/hospitals/statisticsGET /policies/statistics백엔드에서 먼저 고쳐야 했던 것
자동화하려고 보니 필요한 값을 받을 수 없었습니다. CareCode-Repo/CareCode_Interface#79 에서 처리했습니다.
typeDistribution을 항상 null 로 내보냈습니다.getTypeStats()를 조회해 놓고버린 뒤
null을 넣고 있었고,activeFacilities도 늘 0 이었습니다. 응답에 필드가 있으면클라이언트는 값이 온다고 믿습니다.
안전장치
넷 중 하나라도 못 받으면 아무것도 바꾸지 않습니다. 일부만 갱신하고 날짜를 새로 찍으면
낡은 값에 새 날짜가 붙어 거짓말이 됩니다. 이 사이트가 "근거 없는 숫자는 쓰지 않는다" 를
내세우는 이상 그건 치명적입니다.
STATS_API_BASE변수가 없으면 조용히 건너뜁니다. 백엔드가 공개되기 전에 실패로 울리면알림이 무의미해집니다.
검증
실제 백엔드를 띄우고 데이터를 넣어 확인했습니다.
실패 경로도 확인했습니다.
남는 것
STATS_API_BASE저장소 변수에 백엔드 공개 주소를 넣어야 실제로 돕니다. 그건 배포된 주소를아는 사람만 할 수 있어 남겨 둡니다.