File tree Expand file tree Collapse file tree 3 files changed +0
-45
lines changed Expand file tree Collapse file tree 3 files changed +0
-45
lines changed Original file line number Diff line number Diff line change 11import sys
2- import threading
32import warnings
4- from functools import wraps
53
64from django .db import transaction
75from django .db .utils import DatabaseError , OperationalError , ProgrammingError
86from netbox .plugins import PluginConfig
97
108from .constants import APP_LABEL as APP_LABEL
119
12- # Global lock for plugin ready method
13- _plugin_ready_lock = threading .RLock ()
14-
15-
16- def thread_safe_plugin_ready (func ):
17- """
18- Decorator to ensure thread-safe plugin ready method execution.
19- """
20- @wraps (func )
21- def wrapper (self , * args , ** kwargs ):
22- with _plugin_ready_lock :
23- return func (self , * args , ** kwargs )
24- return wrapper
25-
2610
2711def is_running_migration ():
2812 """
@@ -67,7 +51,6 @@ class CustomObjectsPluginConfig(PluginConfig):
6751 required_settings = []
6852 template_extensions = "template_content.template_extensions"
6953
70- @thread_safe_plugin_ready
7154 def ready (self ):
7255 from .models import CustomObjectType
7356 from netbox_custom_objects .api .serializers import get_serializer_class
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 5151from utilities .validators import validate_regex
5252
5353from netbox_custom_objects .constants import APP_LABEL , RESERVED_FIELD_NAMES
54- from netbox_custom_objects .decorators import thread_safe_model_generation
5554from netbox_custom_objects .field_types import FIELD_TYPE_CLASS
5655from netbox_custom_objects .utilities import generate_model
5756
@@ -444,7 +443,6 @@ def register_custom_object_search_index(self, model):
444443 label = f"{ APP_LABEL } .{ self .get_table_model_name (self .id ).lower ()} "
445444 registry ["search" ][label ] = search_index
446445
447- @thread_safe_model_generation
448446 def get_model (
449447 self ,
450448 skip_object_fields = False ,
@@ -550,7 +548,6 @@ def wrapped_post_through_setup(self, cls):
550548
551549 return model
552550
553- @thread_safe_model_generation
554551 def get_model_with_serializer (self ):
555552 from netbox_custom_objects .api .serializers import get_serializer_class
556553 model = self .get_model ()
You can’t perform that action at this time.
0 commit comments