Skip to content

Make the docker_start_app throttle per-app instead of global #132

Description

@ClaydeCode

Problem

docker_start_app is decorated @throttle(5) (shard_core/service/app_tools.py; decorator in shard_core/util/misc.py). The throttle is global per function, not per app name, and silently returns None when throttled. Consequence: a request to app B within 5 seconds of app A starting does not start B — the user stares at the splash screen until the next request or the next control_apps tick (which only starts always_on apps).

Proposal

Key the throttle on the app name (e.g. accept a key function: @throttle(5, key=lambda app_name, *a: app_name)), so each app has its own 5-second window. Keep the silent-drop semantics within one app's window (that is the intended dedupe).

Test: starting two different apps back-to-back must invoke docker for both; starting the same app twice within 5s must invoke docker once.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions