Skip to content

Commit 23d37ca

Browse files
fix: add throttle to flag analytics endpoint (#6454)
1 parent b4017c0 commit 23d37ca

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

api/features/views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
api_view,
2121
authentication_classes,
2222
permission_classes,
23+
throttle_classes,
2324
)
2425
from rest_framework.exceptions import NotFound, ValidationError
2526
from rest_framework.generics import GenericAPIView, get_object_or_404
@@ -31,6 +32,7 @@
3132
from app.pagination import CustomPagination
3233
from app_analytics.analytics_db_service import get_feature_evaluation_data
3334
from app_analytics.influxdb_wrapper import get_multiple_event_list_for_feature
35+
from app_analytics.throttles import InfluxQueryThrottle
3436
from core.constants import FLAGSMITH_UPDATED_AT_HEADER, SDK_ENVIRONMENT_KEY_HEADER
3537
from core.request_origin import RequestOrigin
3638
from environments.authentication import EnvironmentKeyAuthentication
@@ -416,6 +418,7 @@ def get_influx_data(self, request, pk, project_pk): # type: ignore[no-untyped-d
416418
responses={200: FeatureEvaluationDataSerializer()},
417419
)
418420
@action(detail=True, methods=["GET"], url_path="evaluation-data")
421+
@throttle_classes([InfluxQueryThrottle])
419422
def get_evaluation_data(self, request, pk, project_pk): # type: ignore[no-untyped-def]
420423
feature = get_object_or_404(Feature, pk=pk)
421424

0 commit comments

Comments
 (0)