Skip to content

Commit

Permalink
chore: rate limit requests
Browse files Browse the repository at this point in the history
  • Loading branch information
betodealmeida committed Jul 17, 2023
1 parent 9c6d535 commit 27c2f3d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,12 @@ def _try_json_readsha(filepath: str, length: int) -> str | None:
# Configuration for scheduling queries from SQL Lab.
SCHEDULED_QUERIES: dict[str, Any] = {}

# Rate limiting
RATELIMIT_ENABLED = True
AUTH_RATE_LIMITED = True
AUTH_RATE_LIMIT = "2 per 5 second"
RATELIMIT_APPLICATION = "50 per second"

# ------------------------------
# GLOBALS FOR APP Builder
# ------------------------------
Expand Down
2 changes: 1 addition & 1 deletion superset/models/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def export_dashboards( # pylint: disable=too-many-locals
) -> str:
copied_dashboards = []
datasource_ids = set()
for dashboard_id in dashboard_ids:
for dashboard_id in set(dashboard_ids):
# make sure that dashboard_id is an integer
dashboard_id = int(dashboard_id)
dashboard = (
Expand Down

0 comments on commit 27c2f3d

Please sign in to comment.