{% extends "_base.html" %} {% set active_page = "rate_limits" %} {% block title %}Rate Limits — TaskQ Admin{% endblock %} {% block content %}

Rate Limits

{% if not ratelimit_installed %}
{{ notice_text }}
{% elif buckets %}
{% if redis_available %} {% endif %} {% if allow_reset %} {% endif %} {% for b in buckets %} {% set ls = live_states.get(b.bucket_name, {}) %} {% if redis_available %} {% endif %} {% if allow_reset %} {% endif %} {% endfor %}
Bucket Kind Backend Config Status RemainingRedis StatePG State UpdatedActions
{{ b.bucket_name }} {{ b.kind.replace("sliding_window_", "sw/") | replace("token_bucket", "tb") }} {{ b.backend }} {{ b.config_summary }} {% if ls.is_exhausted is defined %} {% if ls.is_exhausted %} exhausted {% elif ls.tokens_remaining is defined and ls.capacity is defined and ls.tokens_remaining < ls.capacity * 0.3 %} low {% else %} ok {% endif %} {% else %} — {% endif %} {% if ls.remaining is defined and ls.remaining > 0 %} {{ ls.remaining | round(1) }} / {{ ls.limit or "—" }} req {% elif ls.tokens_remaining is defined %} {{ ls.tokens_remaining | round(1) }} / {{ ls.capacity or "—" }} tokens {% else %} — {% endif %} {% if ls.retry_after_seconds is defined and ls.retry_after_seconds > 0 %} (retry {{ ls.retry_after_seconds | round(1) }}s) {% endif %} {{ redis_state.get(b.bucket_name, {}) }}{{ b.pg_state or "—" }} {{ b.updated_at or "—" }}
{% if redis_configured and not redis_available and redis_state is none and buckets %}
Redis state unavailable — showing PostgreSQL data only.
{% endif %} {% if has_memory_buckets %}
In-memory rate limits (backend='memory') are per-worker and not queryable from this page.
{% endif %}
{% else %}

No rate limit buckets registered.

{% endif %} {% endblock %}