Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from maxkb.const import CONFIG
from django.utils.translation import gettext as _

max_loop_count = (CONFIG.get("MAX_LOOP_COUNT") or 1000)
max_loop_count = int((CONFIG.get("MAX_LOOP_COUNT") or 1000))


def _is_interrupt_exec(node, node_variable: Dict, workflow_variable: Dict):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your function _is_interrupt_exec has a few minor improvements:

  1. Consistent Type Hinting: You added from collections import Dict, but since Python supports type hints natively with dictionaries like Dict[key_type, value_type], you can remove this line.

  2. Conversion to Integer: The conversion of CONFIG.get("MAX_LOOP_COUNT") to an integer is already done using (int()). This seems redundant and can be removed if the default value (1000) is also converted to an integer implicitly in Python.

Here's the revised code:

from maxkb.const import CONFIG
from django.utils.translation import gettext as _

max_loop_count = int(CONFIG.get("MAX_LOOP_COUNT", 1000))


def _is_interrupt_exec(node, node_variable: dict, workflow_variable: dict):

These changes improve readability slightly without introducing unnecessary complexity.

Expand Down
Loading