From a9192a51a6a38131b6ad4fbeeba87212341f1a41 Mon Sep 17 00:00:00 2001 From: Syed Muhammad Dawoud Sheraz Ali <40599381+DawoudSheraz@users.noreply.github.com> Date: Tue, 10 Jan 2023 09:39:25 +0500 Subject: [PATCH] feat: Get active courses from lms for lms data loading (#3755) --- course_discovery/apps/course_metadata/data_loaders/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/course_discovery/apps/course_metadata/data_loaders/api.py b/course_discovery/apps/course_metadata/data_loaders/api.py index 7fc260d69a..49578e3f38 100644 --- a/course_discovery/apps/course_metadata/data_loaders/api.py +++ b/course_discovery/apps/course_metadata/data_loaders/api.py @@ -79,7 +79,7 @@ def _load_data(self, page): # pragma: no cover response = self._make_request(page) self._process_response(response) - # The courses endpoint has a 40 requests/minute rate limit. + # The courses endpoint has 40 requests/minute rate limit. # This will back off at a rate of 60/120/240 seconds (from the factor 60 and default value of base 2). # This backoff code can still fail because of the concurrent requests all requesting at the same time. # So even in the case of entering into the next minute, if we still exceed our limit for that min, @@ -93,7 +93,7 @@ def _load_data(self, page): # pragma: no cover ) def _make_request(self, page): logger.info('Requesting course run page %d...', page) - params = {'page': page, 'page_size': self.PAGE_SIZE, 'username': self.username} + params = {'page': page, 'page_size': self.PAGE_SIZE, 'username': self.username, 'active_only': True} response = self.api_client.get(self.api_url + '/courses/', params=params) response.raise_for_status() return response.json()