Skip to content

Commit e2a1041

Browse files
feat: allow unlimited running activations
Signed-off-by: Alex <aizquier@redhat.com>
1 parent 7e956b8 commit e2a1041

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/aap_eda/services/activation/manager.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,9 +1075,13 @@ def _get_container_request(self) -> ContainerRequest:
10751075
@staticmethod
10761076
def check_new_process_allowed(parent_type: str, parent_id: int) -> bool:
10771077
"""Check if a new process is allowed."""
1078+
if settings.MAX_RUNNING_ACTIVATIONS < 0:
1079+
return True
1080+
10781081
num_running_processes = models.RulebookProcess.objects.filter(
10791082
status__in=[ActivationStatus.RUNNING, ActivationStatus.STARTING],
10801083
).count()
1084+
10811085
if num_running_processes >= settings.MAX_RUNNING_ACTIVATIONS:
10821086
LOGGER.info(
10831087
"No capacity to start a new rulebook process. "

src/aap_eda/settings/default.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,8 @@ def _get_secret_key() -> str:
445445
ACTIVATION_MAX_RESTARTS_ON_FAILURE = int(
446446
settings.get("ACTIVATION_MAX_RESTARTS_ON_FAILURE", 5)
447447
)
448+
449+
# -1 means no limit
448450
MAX_RUNNING_ACTIVATIONS = int(settings.get("MAX_RUNNING_ACTIVATIONS", 5))
449451

450452
# ---------------------------------------------------------

0 commit comments

Comments
 (0)