Skip to content

Commit

Permalink
Prod ver.2024.09.24
Browse files Browse the repository at this point in the history
fix: temporarily comment out deletion logic (#95)
  • Loading branch information
GanziDaeyong authored Sep 24, 2024
2 parents 421aaac + 240f5d4 commit 4f58a6e
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,15 @@ def menus_transaction(crawled_meals, cursor):
db_menus = cursor.fetchall()
new_menus, deleted_menus, edited_menus = compare_menus(db_menus, crawled_meals, restaurants)

if deleted_menus:
deleted_menus_id = [str(menu.get("id")) for menu in deleted_menus]
delete_menus_query = f"""
DELETE FROM menu
WHERE id in ({','.join(deleted_menus_id)});
"""
cursor.execute(delete_menus_query)
send_deleted_menus_message(deleted_menus)
# 20240924 ~ 20240926 축제 기간 동안 임시 조치입니다.
# if deleted_menus:
# deleted_menus_id = [str(menu.get("id")) for menu in deleted_menus]
# delete_menus_query = f"""
# DELETE FROM menu
# WHERE id in ({','.join(deleted_menus_id)});
# """
# cursor.execute(delete_menus_query)
# send_deleted_menus_message(deleted_menus)

insert_menus_query = """
INSERT INTO menu(restaurant_id, code, date, type, name_kr, price, etc)
Expand Down

0 comments on commit 4f58a6e

Please sign in to comment.