mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-20 15:46:29 +00:00
Prevent using any throttling with group concurrency
The group concurrency modes (reject and queue) are not compatible with any throttling, since we currently can't unlock the group lock when a job doesn't get started (which is the case when throttling is applied).
This commit is contained in:
parent
351de4d9a3
commit
79964fd405
@ -148,17 +148,14 @@ class Job(CoreSysAttributes):
|
||||
)
|
||||
self._rate_limited_calls = {}
|
||||
|
||||
if self.throttle in (
|
||||
JobThrottle.GROUP_THROTTLE,
|
||||
JobThrottle.GROUP_RATE_LIMIT,
|
||||
) and self.concurrency in (
|
||||
if self.throttle is not None and self.concurrency in (
|
||||
JobConcurrency.GROUP_REJECT,
|
||||
JobConcurrency.GROUP_QUEUE,
|
||||
):
|
||||
# We cannot release group locks when Job is not running (e.g. throttled)
|
||||
# which makes these combinations impossible to use currently.
|
||||
raise RuntimeError(
|
||||
f"Job {self.name} is using group throttling ({self.throttle}) with group concurrency ({self.concurrency}), which is not allowed!"
|
||||
f"Job {self.name} is using throttling ({self.throttle}) with group concurrency ({self.concurrency}), which is not allowed!"
|
||||
)
|
||||
|
||||
@property
|
||||
|
Loading…
x
Reference in New Issue
Block a user