Skip to content

Commit dfa3625

Browse files
variable naming
1 parent ec02e2e commit dfa3625

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

dojo/importers/location_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ def _get_tags(tags_field: TagField) -> dict[int, set[str]]:
560560
# under threaded gunicorn / Celery thread pools / ASGI threadpools:
561561
# while disconnected, every thread in the process lost sticky
562562
# enforcement. Thread-local batch state avoids that hazard.
563-
with tag_inheritance.batch():
563+
with tag_inheritance.batch_mode():
564564
for location in locations:
565565
target_tag_names: set[str] = set()
566566
for pid in product_ids_by_location[location.id]:

dojo/tag_inheritance.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
_state = threading.local()
2323

2424

25-
def is_in_batch() -> bool:
25+
def is_in_batch_mode() -> bool:
2626
"""Return True when the current thread is inside an active ``batch()``."""
2727
return bool(getattr(_state, "depth", 0))
2828

2929

3030
@contextmanager
31-
def batch():
31+
def batch_mode():
3232
"""
3333
Suppress per-instance inheritance signals for the calling thread.
3434

dojo/tags_signals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def make_inherited_tags_sticky(sender, instance, action, **kwargs):
3737
# for applying inheritance in bulk; per-row signal work would defeat the
3838
# purpose. This replaces the old `signals.m2m_changed.disconnect(...)`
3939
# pattern, which was process-global and unsafe under threaded workers.
40-
if tag_inheritance.is_in_batch():
40+
if tag_inheritance.is_in_batch_mode():
4141
return
4242
if action in {"post_add", "post_remove"}:
4343
if inherit_product_tags(instance):

0 commit comments

Comments
 (0)