Skip to content

Commit a12bc75

Browse files
committed
Add a setting for storing pageviews
This is so we can disable it if needed based on DB load.
1 parent 82aedba commit a12bc75

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

readthedocs/api/v2/views/footer_views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def get(self, request, format=None):
225225

226226
# increase the page view count for the given page
227227
page_slug = request.GET.get('page', '')
228-
if page_slug:
228+
if page_slug and settings.RTD_STORE_PAGEVIEWS:
229229
increase_page_view_count.delay(
230230
project_slug=context['project'].slug,
231231
version_slug=context['version'].slug,

readthedocs/settings/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ class CommunityBaseSettings(Settings):
9797
RTD_CLEAN_AFTER_BUILD = False
9898
RTD_MAX_CONCURRENT_BUILDS = 4
9999
RTD_BUILD_STATUS_API_NAME = 'docs/readthedocs'
100+
RTD_STORE_PAGEVIEWS = True
100101

101102
# Database and API hitting settings
102103
DONT_HIT_API = False

0 commit comments

Comments
 (0)