File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -1075,9 +1075,13 @@ def _get_container_request(self) -> ContainerRequest:
1075
1075
@staticmethod
1076
1076
def check_new_process_allowed (parent_type : str , parent_id : int ) -> bool :
1077
1077
"""Check if a new process is allowed."""
1078
+ if settings .MAX_RUNNING_ACTIVATIONS < 0 :
1079
+ return True
1080
+
1078
1081
num_running_processes = models .RulebookProcess .objects .filter (
1079
1082
status__in = [ActivationStatus .RUNNING , ActivationStatus .STARTING ],
1080
1083
).count ()
1084
+
1081
1085
if num_running_processes >= settings .MAX_RUNNING_ACTIVATIONS :
1082
1086
LOGGER .info (
1083
1087
"No capacity to start a new rulebook process. "
Original file line number Diff line number Diff line change @@ -445,6 +445,8 @@ def _get_secret_key() -> str:
445
445
ACTIVATION_MAX_RESTARTS_ON_FAILURE = int (
446
446
settings .get ("ACTIVATION_MAX_RESTARTS_ON_FAILURE" , 5 )
447
447
)
448
+
449
+ # -1 means no limit
448
450
MAX_RUNNING_ACTIVATIONS = int (settings .get ("MAX_RUNNING_ACTIVATIONS" , 5 ))
449
451
450
452
# ---------------------------------------------------------
You can’t perform that action at this time.
0 commit comments