소스 검색

fetch 20 data insted of 50 reviews

Mohidul Islam 5 년 전
부모
커밋
cb3ccb2ca7
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      review/review_utils.py

+ 3 - 3
review/review_utils.py

@@ -156,10 +156,10 @@ def fetch_all_review(loc_id):
     update_location_data(loc, average_rating, total_reviews, total_reviews_db)
 
 
-def fetch_last_50_reviews(loc_id):
+def fetch_last_20_reviews(loc_id):
     loc = Location.objects.get(pk=loc_id)
     headers = get_auth_header()
-    url = get_review_list_url(loc_id)+'&pageSize=50'
+    url = get_review_list_url(loc_id)+'&pageSize=20'
     res = get(url, headers=headers)
     if res.status_code == 401:
         return
@@ -177,7 +177,7 @@ def populate_reviews():
     start = timezone.now()
     locations = get_all_location_ids()
     for loc_id in locations:
-        fetch_last_50_reviews(loc_id)
+        fetch_last_20_reviews(loc_id)
     end = timezone.now()
     elapsed = end - start
     print(f'Elapsed time: {elapsed.seconds//60} minutes and {elapsed.seconds % 60} secs.')