Skip to content

Feature/add transaction #3

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

Merged
merged 5 commits into from
Feb 3, 2021
Merged

Feature/add transaction #3

merged 5 commits into from
Feb 3, 2021

Conversation

gina0605
Copy link
Member

@gina0605 gina0605 commented Feb 3, 2021

handler.crawl의 주요 기능

  1. 식단 정보 crawl
    1. menu_crawler의 RestaurantCrawler 이용
  2. 새로 추가된 식당이 있는지 확인
    1. code(식당 이름에서 공백과 기호를 제거한 결과)를 기준으로 비교
    2. 있을 경우 슬랙과 로그에 메세지 남김
  3. 오늘과 그 이후의 식단들 확인
    1. db와 crawling한 결과를 비교
    2. db에만 있고 crawl한 결과에는 없는 메뉴들 삭제
      1. 삭제된 메뉴들에 대해 슬랙과 로그에 메세지 남김
    3. crawl한 결과에만 있고 db에 없는 메뉴들 추가
      1. 추가된 메뉴들에 대해 로그 남김
      2. 추가된 메뉴들 중 snuco에서 여러 줄을 병합한 것(: 기호가 들어간 것)들은 슬랙으로 메세지 보냄

@gina0605 gina0605 requested a review from Dorvin February 3, 2021 12:18
@gina0605 gina0605 changed the base branch from master to develop February 3, 2021 12:19
if all((db_menus[db_idx].get(field, None) == crawled_menus[crawled_idx].get(field)) for field in fields):
db_not_found[db_idx] = False
crawled_not_found[crawled_idx] = False
return list(compress(crawled_menus, crawled_not_found)), list(compress(db_menus, db_not_found))
Copy link
Contributor

Choose a reason for hiding this comment

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

nice!

@Dorvin Dorvin merged commit 76c2a3d into develop Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants